diff --git a/.codedocs b/.codedocs
index 8cb73be71..d8d13cd4c 100644
--- a/.codedocs
+++ b/.codedocs
@@ -1,5 +1,4 @@
# CodeDocs.xyz Configuration File
-EXCLUDE_PATTERNS = */deprecated/*
-DOXYFILE = doc/doxygen.cfg.in
+DOXYFILE = doc/doxygen_codedocs.cfg
diff --git a/.travis.yml b/.travis.yml
index b4788012b..9058a4787 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1 +1,36 @@
+os: linux
+dist: bionic
language: c++
+
+install:
+- chmod u+x ci/travis-ci.sh
+
+stages:
+- doc
+#- build and test
+#- deploy
+
+jobs:
+ include:
+# - stage: build and test
+# env: TITLE="Build CCORE (Linux)."
+# script: ./ci/travis-ci.sh BUILD_CCORE
+# - state: build and test
+# env: TITLE="Run C/C++ static code analyser."
+# script: ./ci/travis-ci.sh ANALYSE_CCORE
+# - stage: build and test
+# env: TITLE="Run unit-tests for CCORE."
+# script: ./ci/travis-ci.sh UT_CCORE
+# - stage: build and test
+# env: TITLE="Run memory leak analyser (valgrind) for CCORE."
+# script: ./ci/travis-ci.sh VALGRIND_CCORE
+# - stage: build and test
+# env: TITLE="PyClustering unit and integration testing."
+# script: ./ci/travis-ci.sh TEST_PYCLUSTERING
+# - stage: build and test
+# os: osx
+# env: TITLE="Build CCORE (MacOS) and intergration testing."
+# script: ./ci/travis-ci.sh BUILD_TEST_CCORE_MACOS
+ - stage: doc
+ env: TITLE="Build documentation."
+ script: ./ci/travis-ci.sh DOCUMENTATION
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c05b558aa..908b083bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,45 +15,48 @@ set(MPIMAX 4 CACHE STRING "Default number of processors used in ctest mpirun -np
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(CLEAN_UP_FILES ./bin/* ./CMakeCache.txt)
-# Find deal.ii library
-find_package(deal.II 9.0.1 QUIET
- HINTS ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
- )
-IF(NOT ${deal.II_FOUND})
- message(FATAL_ERROR "\n"
- "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n"
- "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n"
- "or set an environment variable \"DEAL_II_DIR\" that contains this path."
- )
-ENDIF()
-DEAL_II_INITIALIZE_CACHED_VARIABLES()
-
-# Make sure deal.II has the proper external dependencies
-IF(NOT ${DEAL_II_WITH_MPI})
- message(FATAL_ERROR "\n" "*** deal.II needs to be configured with -DDEAL_II_WITH_MPI=ON ***\n\n")
-ENDIF()
-IF(NOT ${DEAL_II_WITH_TRILINOS})
- message(FATAL_ERROR "\n" "*** deal.II needs to be configured with -DDEAL_II_WITH_TRILINOS=ON ***\n\n")
-ENDIF()
-IF(NOT ${DEAL_II_WITH_P4EST})
- message(FATAL_ERROR "\n" "*** deal.II needs to be configured with -DDEAL_II_WITH_P4EST=ON ***\n\n")
-ENDIF()
-IF(NOT ${DEAL_II_WITH_METIS})
- message(FATAL_ERROR "\n" "*** deal.II needs to be configured with -DDEAL_II_WITH_METIS=ON ***\n\n")
-ENDIF()
-
-# Use ld.gold for faster linking
-option(USE_LD_GOLD "Use GNU gold linker" OFF)
-if(USE_LD_GOLD AND "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
- execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version OUTPUT_VARIABLE stdout ERROR_QUIET)
- if("${stdout}" MATCHES "GNU gold")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
- else()
- message(WARNING "GNU gold linker isn't available, using the default system linker.")
- endif()
-endif()
-
+option(DOC_ONLY "Only generate code for documentation sake. Not compilable." OFF)
+if(NOT DOC_ONLY)
+ # Find deal.ii library
+ find_package(deal.II 9.0.1 QUIET
+ HINTS ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
+ )
+ IF(NOT ${deal.II_FOUND})
+ message(FATAL_ERROR "\n"
+ "*** Could not locate a (sufficiently recent) version of deal.II. ***\n\n"
+ "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake\n"
+ "or set an environment variable \"DEAL_II_DIR\" that contains this path."
+ )
+ ENDIF()
+ DEAL_II_INITIALIZE_CACHED_VARIABLES()
+
+ # Make sure deal.II has the proper external dependencies
+ IF(NOT ${DEAL_II_WITH_MPI})
+ message(FATAL_ERROR "\n" "*** deal.II needs to be configured with -DDEAL_II_WITH_MPI=ON ***\n\n")
+ ENDIF()
+ IF(NOT ${DEAL_II_WITH_TRILINOS})
+ message(FATAL_ERROR "\n" "*** deal.II needs to be configured with -DDEAL_II_WITH_TRILINOS=ON ***\n\n")
+ ENDIF()
+ IF(NOT ${DEAL_II_WITH_P4EST})
+ message(FATAL_ERROR "\n" "*** deal.II needs to be configured with -DDEAL_II_WITH_P4EST=ON ***\n\n")
+ ENDIF()
+ IF(NOT ${DEAL_II_WITH_METIS})
+ message(FATAL_ERROR "\n" "*** deal.II needs to be configured with -DDEAL_II_WITH_METIS=ON ***\n\n")
+ ENDIF()
+
+ # Use ld.gold for faster linking
+ option(USE_LD_GOLD "Use GNU gold linker" OFF)
+ if(USE_LD_GOLD AND "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+ execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version OUTPUT_VARIABLE stdout ERROR_QUIET)
+ if("${stdout}" MATCHES "GNU gold")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
+ else()
+ message(WARNING "GNU gold linker isn't available, using the default system linker.")
+ endif()
+ endif()
+endif() # DOC_ONLY
+
add_custom_target(1D COMMAND ${CMAKE_COMMAND} -E echo "Makes all 1D executables, including tests. Allows ctest -R 1D")
add_custom_target(2D COMMAND ${CMAKE_COMMAND} -E echo "Makes all 2D executables, including tests. Allows ctest -R 2D")
add_custom_target(3D COMMAND ${CMAKE_COMMAND} -E echo "Makes all 3D executables, including tests. Allows ctest -R 3D")
diff --git a/INSTALL.md b/INSTALL.md
index 428ad264b..879fdf7cf 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -1,3 +1,64 @@
+## deal.II
+
+This is the main library being used by this code. Since we are using advanced features, we only support the `master` of deal.II, which means it will have to be installed from source by cloning their [repository](https://github.com/dealii/dealii).
+
+Most of the packages are readily available through `apt install`. p4est might need to be installed from source since the current p4est version available on `apt` is lower than what is required by deal.II (p4est 2.0). A small set of instructions is available [here](https://www.dealii.org/current/external-libs/p4est.html).
+
+There is an [example script](doc/install_dealii.sh) for what has been used to install deal.II. You may need to provide the path such as `-DTRILINOS_DIR` if CMake does not find the package on its own.
+
+The deal.II library has been setup with the following options:
+
+~~~~
+ deal.II configuration:
+ CMAKE_BUILD_TYPE: DebugRelease
+ BUILD_SHARED_LIBS: ON
+ CMAKE_INSTALL_PREFIX: /home/ddong/Codes/dealii/install
+ CMAKE_SOURCE_DIR: /home/ddong/Codes/dealii
+ (version 9.0.1, shortrev 097bf59e49)
+ CMAKE_BINARY_DIR: /home/ddong/Codes/dealii/build
+ CMAKE_CXX_COMPILER: GNU 7.3.0 on platform Linux x86_64
+ /usr/bin/mpicxx
+
+ Configured Features (DEAL_II_ALLOW_BUNDLED = ON, DEAL_II_ALLOW_AUTODETECTION = ON):
+ ( DEAL_II_WITH_64BIT_INDICES = OFF )
+ DEAL_II_WITH_ADOLC set up with external dependencies
+ DEAL_II_WITH_ARPACK set up with external dependencies
+ ( DEAL_II_WITH_ASSIMP = OFF )
+ DEAL_II_WITH_BOOST set up with external dependencies
+ ( DEAL_II_WITH_CUDA = OFF )
+ DEAL_II_WITH_CXX14 = ON
+ DEAL_II_WITH_CXX17 = ON
+ DEAL_II_WITH_GMSH set up with external dependencies
+ DEAL_II_WITH_GSL set up with external dependencies
+ ( DEAL_II_WITH_HDF5 = OFF )
+ DEAL_II_WITH_LAPACK set up with external dependencies
+ DEAL_II_WITH_METIS set up with external dependencies
+ DEAL_II_WITH_MPI set up with external dependencies
+ DEAL_II_WITH_MUPARSER set up with bundled packages
+ ( DEAL_II_WITH_NANOFLANN = OFF )
+ ( DEAL_II_WITH_NETCDF = OFF )
+ DEAL_II_WITH_OPENCASCADE set up with external dependencies
+ DEAL_II_WITH_P4EST set up with external dependencies
+ DEAL_II_WITH_PETSC set up with external dependencies
+ DEAL_II_WITH_SCALAPACK set up with external dependencies
+ DEAL_II_WITH_SLEPC set up with external dependencies
+ DEAL_II_WITH_SUNDIALS set up with external dependencies
+ ( DEAL_II_WITH_THREADS = OFF )
+ DEAL_II_WITH_TRILINOS set up with external dependencies
+ DEAL_II_WITH_UMFPACK set up with external dependencies
+ DEAL_II_WITH_ZLIB set up with external dependencies
+
+ Component configuration:
+ ( DEAL_II_COMPONENT_DOCUMENTATION = OFF )
+ DEAL_II_COMPONENT_EXAMPLES
+ ( DEAL_II_COMPONENT_PACKAGE = OFF )
+ ( DEAL_II_COMPONENT_PYTHON_BINDINGS = OFF )
+
+ Detailed information (compiler flags, feature configuration) can be found in detailed.log
+
+ Run $ make info to print a help message with a list of top level targets
+~~~~
+
## Installation of PHiLiP on Beluga cluster
This section is aimed McGill's group who use Compute Canada's Beluga cluster.
@@ -72,65 +133,6 @@ since it takes a very long time.
If you have any questions, feel free to contact me.
-## deal.II
-
-This is the main library being used by this code. Most of the packages are readily available through apt. p4est might need to be installed from source since the apt version is lower than what is required by deal.II.
-
-There is an [example script](install_dealii.sh) for what has been used to install deal.II. You may need to provide the path such as `-DTRILINOS_DIR` if CMake does not find the package on its own.
-
-The deal.II library has been setup with the following options:
-
-~~~~
- deal.II configuration:
- CMAKE_BUILD_TYPE: DebugRelease
- BUILD_SHARED_LIBS: ON
- CMAKE_INSTALL_PREFIX: /home/ddong/Codes/dealii/install
- CMAKE_SOURCE_DIR: /home/ddong/Codes/dealii
- (version 9.0.1, shortrev 097bf59e49)
- CMAKE_BINARY_DIR: /home/ddong/Codes/dealii/build
- CMAKE_CXX_COMPILER: GNU 7.3.0 on platform Linux x86_64
- /usr/bin/mpicxx
-
- Configured Features (DEAL_II_ALLOW_BUNDLED = ON, DEAL_II_ALLOW_AUTODETECTION = ON):
- ( DEAL_II_WITH_64BIT_INDICES = OFF )
- DEAL_II_WITH_ADOLC set up with external dependencies
- DEAL_II_WITH_ARPACK set up with external dependencies
- ( DEAL_II_WITH_ASSIMP = OFF )
- DEAL_II_WITH_BOOST set up with external dependencies
- ( DEAL_II_WITH_CUDA = OFF )
- DEAL_II_WITH_CXX14 = ON
- DEAL_II_WITH_CXX17 = ON
- DEAL_II_WITH_GMSH set up with external dependencies
- DEAL_II_WITH_GSL set up with external dependencies
- ( DEAL_II_WITH_HDF5 = OFF )
- DEAL_II_WITH_LAPACK set up with external dependencies
- DEAL_II_WITH_METIS set up with external dependencies
- DEAL_II_WITH_MPI set up with external dependencies
- DEAL_II_WITH_MUPARSER set up with bundled packages
- ( DEAL_II_WITH_NANOFLANN = OFF )
- ( DEAL_II_WITH_NETCDF = OFF )
- DEAL_II_WITH_OPENCASCADE set up with external dependencies
- DEAL_II_WITH_P4EST set up with external dependencies
- DEAL_II_WITH_PETSC set up with external dependencies
- DEAL_II_WITH_SCALAPACK set up with external dependencies
- DEAL_II_WITH_SLEPC set up with external dependencies
- DEAL_II_WITH_SUNDIALS set up with external dependencies
- ( DEAL_II_WITH_THREADS = OFF )
- DEAL_II_WITH_TRILINOS set up with external dependencies
- DEAL_II_WITH_UMFPACK set up with external dependencies
- DEAL_II_WITH_ZLIB set up with external dependencies
-
- Component configuration:
- ( DEAL_II_COMPONENT_DOCUMENTATION = OFF )
- DEAL_II_COMPONENT_EXAMPLES
- ( DEAL_II_COMPONENT_PACKAGE = OFF )
- ( DEAL_II_COMPONENT_PYTHON_BINDINGS = OFF )
-
- Detailed information (compiler flags, feature configuration) can be found in detailed.log
-
- Run $ make info to print a help message with a list of top level targets
-~~~~
-
To compile deal.II on the Beluga cluster, load the following modules.
~~~~
diff --git a/README.md b/README.md
index 6c5895dc0..e4dc0e69f 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,16 @@ The math supporting this code can be viewed in this **very rough draft in progre
- Supported elements: LINEs, QUADs, HEXs since it uses deal.II
- Supported refinements: h (size) or p (order).
+## Documentation
+
+The code itself is documented using Doxygen, and the latest documentation is hosted on [codedocs.xyz](https://codedocs.xyz/dougshidong/PHiLiP/).
+
+Since deal.II is heavily used, their [documentation](https://www.dealii.org/developer/doxygen/deal.II/index.html) is probably the most useful.
+
+Another great ressource is the [deal.II Google Groups](https://groups.google.com/forum/#!forum/dealii), where developers are actively answering questions.
+
+Finally, I am also always available to answer questions regarding the code by e-mail at doug.shi-dong@mail.mcgill.ca
+
## Building/Running the Code
The code has been succesfully built in the following environments:
@@ -55,10 +65,12 @@ The html documentation can be accessed by pointing a browser at `ROOT/doc/html/i
## Testing
+A list of currently known failing tests is kept in the [GitHub issues](https://github.com/dougshidong/PHiLiP/issues?q=is%3Aissue+is%3Aopen+label%3Atestfail) with `testfail` tags.
+
Testing can be performed using CMake's `ctest` functionality. After successfully compiling the project, all tests can be
run by executing:
```sh
-$ ROOT$ make test (which is equivalent to ROOT$ make test)
+$ ROOT$ ctest (which is equivalent to ROOT$ make test)
```
An alternative make target is provided to run tests with --output-on-failure:
@@ -87,7 +99,10 @@ For a serial run, you may simply use gdb as intended
ROOT$ gdb --args commmand_to_launch_test
GDB$ run (Executes the program. Can re-launch the program if you forgot to put breakpoints.)
```
-For example `--args /home/ddong/Codes/PHiLiP_temp/PHiLiP/build_debug/bin/PHiLiP_2D "-i" "/home/ddong/Codes/PHiLiP_temp/PHiLiP/build_de bug/tests/adv ection_implicit/2d_advection_implicit_strong.prm`.
+For example
+```
+gdb --args /home/ddong/Codes/PHiLiP_temp/PHiLiP/build_debug/bin/PHiLiP_2D "-i" "/home/ddong/Codes/PHiLiP_temp/PHiLiP/build_debug/tests/advection_implicit/2d_advection_implicit_strong.prm
+```
Additional useful commands are:
@@ -99,6 +114,14 @@ GDB$ next (Execute the next line of code in the function. Will NOT go into the f
GDB$ quit
```
+### Memory
+
+Memory leaks can be detected using Valgrind's tool `memcheck`. The application must be compiled in `Debug` mode. For example
+
+```
+valgrind --leak-check=full --track-origins=yes /home/ddong/Codes/PHiLiP/build_debug/bin/2D_HighOrder_MappingFEField
+```
+
### Parallel debugging
If the error only occurs when using parallelism, you can use the following example command
@@ -107,6 +130,45 @@ mpirun -np 2 xterm -hold -e gdb -ex 'break MPI_Abort' -ex run --args /home/ddong
```
This launches 2 xterm processes, each of which will launch gdb processes that will run the code and will have a breakpoint when MPI_Abort is encountered.
+## Performance
+
+Problems tend to show up in the 3D version if an algorithm has been implemented inefficiently. It is therefore highly recommended that a 3D test accompanies the implemented features.
+
+### Computational
+
+Computational bottlenecks can be inspected using Valgrind's tool `callgrind`. It is used as such
+
+```
+valgrind --tool=callgrind /home/ddong/Codes/PHiLiP/build_release/bin/2D_RBF_mesh_movement
+```
+
+This will result in a `callgrind.out.#####`. A visualizer such as `kcachegrind` (available through `apt`) can then be used to sort through the results. For example:
+
+```kcachegrind callgrind.out.24250```
+
+### Memory
+
+Apart from memory leaks, it is possible that some required allocations demand too much memory. Valgrind also has a tool for this called `massif`. For example
+
+```valgrind --tool=massif /home/ddong/Codes/PHiLiP/build_debug/bin/3D_RBF_mesh_movement```
+
+will generate a `massif.out.#####` file that can be visualized using `massif-visualizer` (available through `apt`) as
+
+```massif-visualizer massif.out.18580```
+
+
+## Contributing checklist
+
+1. A unit test, integration test, or regression test accompanies the feature. Tests longer than a few seconds should be tagged as with the suffix MEDIUM, and tests a minute or longer should be tagged with LONG.
+ * A unit test is often most appropriate, and is aimed at testing a single component of the code. See the test on [Euler's primitive to conservative conversion](https://github.com/dougshidong/PHiLiP/blob/master/tests/unit_tests/euler_unit_test/euler_convert_primitive_conservative.cpp)
+ * An integration test runs the entire main program by taking an input file and calling PHiLiP_1/2/3D. It should be derived from the [`TestBase` class](https://github.com/dougshidong/PHiLiP/blob/master/src/testing/tests.h), and have a control file located in the [integration test directory](https://github.com/dougshidong/PHiLiP/tree/master/tests/integration_tests_control_files). Since integrations tests uses multiple components, they usually take longer. Furthermore, the cause of failure is sometimes less obvious. A good suggestion is to use an existing test control file, and only change 1 parameter to help pinpoint issues when it fails.
+ * A regression test stores previously computed data to validate future results. Note that this type of test is rarely appropriate since valid changes in the code can fail this type of test. If implemented, a script/code should be made available such that newly computed results can replace the old results. See [file1](https://github.com/dougshidong/PHiLiP/blob/master/tests/unit_tests/regression/jacobian_matrix_regression.cpp) and [file2](https://github.com/dougshidong/PHiLiP/blob/master/tests/unit_tests/regression/matrix_data/copy_matrices.sh)
+2. The feature has been documented.
+ * Function and member variable documentation should be presented in the associated header file. `make doc` should generate a html file in the `/path_to_build/doc/html/index.html` that can be opened used your browser of choice.
+ * Comments in the code as appropriate.
+3. The `master` branch of `https://github.com/dougshidong/PHiLiP` has been merged into your fork and merge conflicts have been resolved.
+4. The entire `ctest` suite has been run in `Release` mode and the short/medium length tests have been run in `Debug` mode (using `ctest -E LONG`). Please save the log for the next point.
+5. Submit a pull request with a log of the tests.
# License
diff --git a/ci/travis-ci.sh b/ci/travis-ci.sh
new file mode 100755
index 000000000..851185218
--- /dev/null
+++ b/ci/travis-ci.sh
@@ -0,0 +1,245 @@
+#
+# @authors Andrei Novikov (pyclustering@yandex.ru)
+# @date 2014-2019
+# @copyright GNU Public License
+#
+# GNU_PUBLIC_LICENSE
+# pyclustering is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# pyclustering 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+
+# CCORE_X64_BINARY_FOLDER=pyclustering/core/x64/linux
+# CCORE_X64_BINARY_PATH=$CCORE_X64_BINARY_FOLDER/ccore.so
+#
+# CCORE_X86_BINARY_FOLDER=pyclustering/core/x86/linux
+# CCORE_X86_BINARY_PATH=$CCORE_X86_BINARY_FOLDER/ccore.so
+#
+DOXYGEN_FILTER=( "warning: Unexpected new line character" )
+
+
+print_error() {
+ echo "[PHiLiP CI] ERROR: $1"
+}
+
+
+print_info() {
+ echo "[PHiLiP CI] INFO: $1"
+}
+
+
+check_failure() {
+ if [ $? -ne 0 ] ; then
+ if [ -z $1 ] ; then
+ print_error $1
+ else
+ print_error "Failure exit code is detected."
+ fi
+ exit 1
+ fi
+}
+
+
+check_error_log_file() {
+ problems_amount=$(cat $1 | wc -l)
+ printf "Total amount of errors and warnings: '%d'\n" "$problems_amount"
+
+ if [ $problems_amount -ne 0 ] ; then
+ print_info "List of warnings and errors:"
+ cat $1
+
+ print_error $2
+ exit 1
+ fi
+}
+
+
+build_ccore() {
+ cd $TRAVIS_BUILD_DIR/ccore/
+
+ [ -f stderr.log ] && rm stderr.log
+ [ -f stdout.log ] && rm stdout.log
+
+ if [ "$1" == "x64" ]; then
+ make ccore_x64 > >(tee -a stdout.log) 2> >(tee -a stderr.log >&2)
+ check_error_log_file stderr.log "Building CCORE (x64): FAILURE."
+ elif [ "$1" == "x86" ]; then
+ make ccore_x86 > >(tee -a stdout.log) 2> >(tee -a stderr.log >&2)
+ check_error_log_file stderr.log "Building CCORE (x86): FAILURE."
+ else
+ print_error "Unknown CCORE platform is specified."
+ exit 1
+ fi
+
+ cd -
+}
+
+
+run_build_ccore_job() {
+ print_info "CCORE (C++ code building):"
+ print_info "- Build CCORE library for x64 platform."
+ print_info "- Build CCORE library for x86 platform."
+
+ #install requirement for the job
+ print_info "Install requirement for CCORE building."
+
+ sudo apt-get install -qq g++-5
+ sudo apt-get install -qq g++-5-multilib
+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 50
+
+ # show info
+ g++ --version
+ gcc --version
+
+ # build ccore library
+ build_ccore x64
+ build_ccore x86
+
+ print_info "Upload ccore x64 binary."
+ upload_binary x64 linux
+
+ print_info "Upload ccore x86 binary."
+ upload_binary x86 linux
+}
+
+run_valgrind_ccore_job() {
+ print_info "VALGRIND CCORE (C++ code valgrind shock checking):"
+ print_info "- Run unit-tests of pyclustering."
+ print_info "- Shock memory leakage detection by valgrind."
+
+ # install requirements for the job
+ sudo apt-get install -qq g++-5
+ sudo apt-get install -qq g++-5-multilib
+ sudo apt-get install -qq valgrind
+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 50
+
+ # build and run unit-test project under valgrind to check memory leakage
+ cd ccore/
+
+ make valgrind_shock
+ check_failure "CCORE shock memory leakage status: FAILURE."
+}
+
+run_integration_test_job() {
+ print_info "INTEGRATION TESTING ('ccore' <-> 'pyclustering' for platform '$1')."
+ print_info "- Build CCORE library."
+ print_info "- Run integration tests of pyclustering."
+
+ PLATFORM_TARGET=$1
+
+ # install requirements for the job
+ install_miniconda $PLATFORM_TARGET
+
+ sudo apt-get install -qq g++-5 gcc-5
+ sudo apt-get install -qq g++-5-multilib gcc-5-multilib
+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 50
+ sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-5 50
+
+ # build ccore library
+ build_ccore $PLATFORM_TARGET
+
+ # run integration tests
+ python pyclustering/tests/tests_runner.py --integration
+}
+
+
+run_doxygen_job() {
+ print_info "DOXYGEN (documentation generation)."
+ print_info "- Generate documentation and check for warnings."
+
+ sudo apt update
+ print_info "Install cmake"
+ sudo apt install cmake
+
+ print_info "Install doxygen"
+ sudo apt install doxygen
+
+ print_info "Install requirements for doxygen."
+ sudo apt install graphviz
+ sudo apt install texlive
+
+ rm -rf build_doc;
+ mkdir build_doc; cd build_doc;
+ cmake ../ -DDOC_ONLY=ON
+
+ print_info "Prepare log files."
+ report_file=doxygen_problems.log
+ report_file_filtered=doxygen_problems_filtered.log
+
+ rm -f $report_file
+ rm -f $report_file_filtered
+
+ print_info "Generate documentation."
+ doxygen --version
+#make doc 2>&1 | tee $report_file > >(while read line; do echo -e "\e[01;31m$line\e[0m" >&2; done)
+ make doc > $report_file 2>&1
+ awk '/error|warning/ {print}' $report_file > $report_file_filtered
+ cat $report_file_filtered
+
+ check_error_log_file $report_file_filtered "Building doxygen documentation: FAILURE."
+ print_info "Finished doxygen documentation test. SUCCESS."
+}
+
+
+set -e
+set -x
+
+if [[ $TRAVIS_COMMIT_MESSAGE == *"[no-build]"* ]]; then
+ print_info "Option '[no-build]' is detected, sources will not be built, checked, verified and published."
+ exit 0
+fi
+
+if [[ $TRAVIS_COMMIT_MESSAGE == *"[build-only-osx]"* ]]; then
+ if [[ $1 == BUILD_TEST_CCORE_MACOS ]]; then
+ print_info "Option '[build-only-osx]' is detected, mac os build will be started."
+ else
+ print_info "Option '[build-only-osx]' is detected, sources will not be built, checked, verified and published."
+ exit 0
+ fi
+fi
+
+case $1 in
+ BUILD_CCORE)
+ run_build_ccore_job ;;
+
+ ANALYSE_CCORE)
+ run_analyse_ccore_job ;;
+
+ UT_CCORE)
+ run_ut_ccore_job ;;
+
+ VALGRIND_CCORE)
+ run_valgrind_ccore_job ;;
+
+ TEST_PYCLUSTERING)
+ run_test_pyclustering_job ;;
+
+ IT_CCORE_X86)
+ run_integration_test_job x86 ;;
+
+ IT_CCORE_X64)
+ run_integration_test_job x64 ;;
+
+ BUILD_TEST_CCORE_MACOS)
+ run_build_test_ccore_macos_job ;;
+
+ DOCUMENTATION)
+ run_doxygen_job ;;
+
+ DEPLOY)
+ run_deploy_job ;;
+
+ *)
+ print_error "Unknown target is specified: '$1'"
+ exit 1 ;;
+esac
diff --git a/cmakedocs.cmake b/cmakedocs.cmake
new file mode 100644
index 000000000..95aed7cd4
--- /dev/null
+++ b/cmakedocs.cmake
@@ -0,0 +1,130 @@
+project(PHiLiP)
+
+CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0)
+set(CMAKE_CXX_COMPILER mpicxx)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_STANDARD 17)
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
+
+set(MPIMAX 4 CACHE STRING "Default number of processors used in ctest mpirun -np MPIMAX. Not the same as ctest -jX")
+
+
+#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -g")
+
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+set(CLEAN_UP_FILES ./bin/* ./CMakeCache.txt)
+
+# Use ld.gold for faster linking
+option(USE_LD_GOLD "Use GNU gold linker" OFF)
+if(USE_LD_GOLD AND "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+ execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version OUTPUT_VARIABLE stdout ERROR_QUIET)
+ if("${stdout}" MATCHES "GNU gold")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
+ else()
+ message(WARNING "GNU gold linker isn't available, using the default system linker.")
+ endif()
+endif()
+
+add_custom_target(1D COMMAND ${CMAKE_COMMAND} -E echo "Makes all 1D executables, including tests. Allows ctest -R 1D")
+add_custom_target(2D COMMAND ${CMAKE_COMMAND} -E echo "Makes all 2D executables, including tests. Allows ctest -R 2D")
+add_custom_target(3D COMMAND ${CMAKE_COMMAND} -E echo "Makes all 3D executables, including tests. Allows ctest -R 3D")
+SET(_dimension_targets "#
+# make 1D - to build all 1D executables, including tests, allow 'ctest -R 1D'
+# make 2D - to build all 2D executables, including tests, allow 'ctest -R 2D'
+# make 3D - to build all 3D executables, including tests, allow 'ctest -R 3D' ")
+SET(_philip_targets "#
+# make PHiLiP_1D - to build main program (wihtout tests) in 1D
+# make PHiLiP_2D - to build main program (wihtout tests) in 2D
+# make PHiLiP_3D - to build main program (wihtout tests) in 3D ")
+add_custom_target(unit_tests)
+
+# Source code
+include_directories(src)
+add_subdirectory(src)
+
+# Test directory
+enable_testing()
+add_subdirectory(tests)
+
+# Documentation
+add_subdirectory(doc)
+
+##########
+# Add a few commands to make life easier
+
+#include(ProcessorCount)
+#ProcessorCount(NPROC)
+
+# Define custom targets to easily switch the build type:
+add_custom_target(debug
+ COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR}
+ COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target all
+ COMMENT "Switch CMAKE_BUILD_TYPE to Debug"
+ )
+
+add_custom_target(release
+ COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR}
+ COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target all
+ COMMENT "Switch CMAKE_BUILD_TYPE to Release"
+ )
+IF(${DEAL_II_BUILD_TYPE} MATCHES "DebugRelease")
+SET(_switch_targets "#
+# make debug - to switch the build type to 'Debug'
+# make release - to switch the build type to 'Release' "
+)
+ENDIF()
+
+# Print out some usage information to file:
+FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake
+"MESSAGE(
+\"###
+#
+# Project ${TARGET} set up with ${DEAL_II_PACKAGE_NAME}-${DEAL_II_PACKAGE_VERSION} found at
+# ${DEAL_II_PATH}
+#
+# CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}
+#
+# You can now run
+# make - to compile and link all the program and tests.
+${_philip_targets}
+${_dimension_targets}
+${_switch_targets}
+")
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake
+"#
+# make clean - to remove the generated executable as well as
+# all intermediate compilation files
+# make info - to view this message again
+#
+# Note that you may append -j N, where N represents the number of processors
+# to compile with. If you are compiling on 8GB of memory, be careful not to
+# use too many processors, as you will run out of RAM. If you have (m) GB of
+# available memory, you can use around (m-1) processor without having to use the swap.
+#
+###\")"
+)
+
+add_custom_target(info
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake
+)
+
+# Print this message once:
+#IF(NOT USAGE_PRINTED)
+# INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake)
+# SET(USAGE_PRINTED TRUE CACHE INTERNAL "")
+#ELSE()
+# MESSAGE(STATUS "Run make info to print a detailed help message")
+#ENDIF()
+INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake)
+MESSAGE(STATUS "Run make info to print a detailed help message")
+
+MESSAGE(STATUS "
+###
+#
+# Using MPIMAX = ${MPIMAX}, which sets the default values used by ctest for the MPI runs.
+# Can use cmake ../ -DMPIMAX=XX to change this default value.
+#
+###
+")
diff --git a/doc/doxygen.cfg.in b/doc/doxygen.cfg.in
index b59277755..d805e64da 100644
--- a/doc/doxygen.cfg.in
+++ b/doc/doxygen.cfg.in
@@ -4,9 +4,9 @@
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
-PROJECT_NAME = "@CMAKE_PROJECT_NAME@"
+PROJECT_NAME = "[P]arallel [Hi]gh-order [Li]brary for [P]DEs"
PROJECT_NUMBER = "@PHiLiP_VERSION@"
-PROJECT_BRIEF = "(P)arallel (Hi)gh-order (Li)brary for PDEs"
+PROJECT_BRIEF = "Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods"
PROJECT_LOGO =
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
@@ -40,7 +40,7 @@ BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
-DISTRIBUTE_GROUP_DOC = NO
+DISTRIBUTE_GROUP_DOC = YES
GROUP_NESTED_COMPOUNDS = NO
SUBGROUPING = YES
INLINE_GROUPED_CLASSES = NO
@@ -50,7 +50,7 @@ LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
-EXTRACT_ALL = YES
+EXTRACT_ALL = NO
EXTRACT_PRIVATE = YES
EXTRACT_PACKAGE = NO
EXTRACT_STATIC = YES
@@ -94,7 +94,7 @@ QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
-WARN_NO_PARAMDOC = YES
+WARN_NO_PARAMDOC = NO
WARN_AS_ERROR = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
@@ -109,13 +109,14 @@ FILE_PATTERNS = *.cpp \
*.h.in \
*.dox \
# *.md \ # doxygen was given errors for relative paths in markdown files.
- *.mk
+# *.mk
RECURSIVE = YES
EXCLUDE = @PROJECT_SOURCE_DIR@/README.md
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */build/* \
*/build_*/* \
*/src/deprecated/* \
+ */src/dummy/* \
*/deprecated/* \
*/external/*
EXCLUDE_SYMBOLS =
diff --git a/doc/doxygen_codedocs.cfg b/doc/doxygen_codedocs.cfg
new file mode 100644
index 000000000..fbe523698
--- /dev/null
+++ b/doc/doxygen_codedocs.cfg
@@ -0,0 +1,330 @@
+# Doxyfile 1.8.11
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING = UTF-8
+PROJECT_NAME = "[P]arallel [Hi]gh-order [Li]brary for [P]DEs"
+PROJECT_NUMBER = "Latest"
+PROJECT_BRIEF = "Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods"
+PROJECT_LOGO =
+OUTPUT_DIRECTORY =
+CREATE_SUBDIRS = NO
+ALLOW_UNICODE_NAMES = NO
+OUTPUT_LANGUAGE = English
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF =
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH = ./
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = NO
+QT_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS = YES
+SEPARATE_MEMBER_PAGES = NO
+TAB_SIZE = 4
+ALIASES =
+TCL_SUBST =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+OPTIMIZE_FOR_FORTRAN = NO
+OPTIMIZE_OUTPUT_VHDL = NO
+EXTENSION_MAPPING =
+MARKDOWN_SUPPORT = YES
+AUTOLINK_SUPPORT = YES
+BUILTIN_STL_SUPPORT = NO
+CPP_CLI_SUPPORT = NO
+SIP_SUPPORT = NO
+IDL_PROPERTY_SUPPORT = YES
+DISTRIBUTE_GROUP_DOC = YES
+GROUP_NESTED_COMPOUNDS = NO
+SUBGROUPING = YES
+INLINE_GROUPED_CLASSES = NO
+INLINE_SIMPLE_STRUCTS = NO
+TYPEDEF_HIDES_STRUCT = NO
+LOOKUP_CACHE_SIZE = 0
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = YES
+EXTRACT_PACKAGE = NO
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = NO
+EXTRACT_ANON_NSPACES = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+HIDE_COMPOUND_REFERENCE= NO
+SHOW_INCLUDE_FILES = YES
+SHOW_GROUPED_MEMB_INC = NO
+FORCE_LOCAL_INCLUDES = NO
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_MEMBERS_CTORS_1ST = NO
+SORT_GROUP_NAMES = NO
+SORT_BY_SCOPE_NAME = NO
+STRICT_PROTO_MATCHING = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_FILES = YES
+SHOW_NAMESPACES = YES
+FILE_VERSION_FILTER =
+LAYOUT_FILE = ./doc/DoxygenLayout.xml
+CITE_BIB_FILES = ./doc/code.bib
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+WARN_AS_ERROR = NO
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = ./
+INPUT_ENCODING = UTF-8
+FILE_PATTERNS = *.cpp \
+ *.h \
+ *.hpp \
+ *.h.in \
+ *.dox \
+# *.md \ # doxygen was given errors for relative paths in markdown files.
+# *.mk
+RECURSIVE = YES
+EXCLUDE = ./README.md
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS = */build/* \
+ */build_*/* \
+ */src/deprecated/* \
+ */src/dummy/* \
+ */deprecated/* \
+ */external/*
+EXCLUDE_SYMBOLS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+FILTER_SOURCE_PATTERNS =
+USE_MDFILE_AS_MAINPAGE =
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = YES
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION = NO
+REFERENCES_LINK_SOURCE = YES
+SOURCE_TOOLTIPS = YES
+USE_HTAGS = NO
+VERBATIM_HEADERS = YES
+CLANG_ASSISTED_PARSING = NO
+CLANG_OPTIONS =
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = YES
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_EXTRA_STYLESHEET =
+HTML_EXTRA_FILES =
+HTML_COLORSTYLE_HUE = 240
+HTML_COLORSTYLE_SAT = 255
+HTML_COLORSTYLE_GAMMA = 40
+HTML_TIMESTAMP = YES
+HTML_DYNAMIC_SECTIONS = NO
+HTML_INDEX_NUM_ENTRIES = 100
+GENERATE_DOCSET = NO
+DOCSET_FEEDNAME = "Doxygen generated docs"
+DOCSET_BUNDLE_ID = org.doxygen.Project
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+DOCSET_PUBLISHER_NAME = Publisher
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+CHM_INDEX_ENCODING =
+BINARY_TOC = NO
+TOC_EXPAND = NO
+GENERATE_QHP = NO
+QCH_FILE =
+QHP_NAMESPACE = org.doxygen.Project
+QHP_VIRTUAL_FOLDER = doc
+QHP_CUST_FILTER_NAME =
+QHP_CUST_FILTER_ATTRS =
+QHP_SECT_FILTER_ATTRS =
+QHG_LOCATION =
+GENERATE_ECLIPSEHELP = NO
+ECLIPSE_DOC_ID = org.doxygen.Project
+DISABLE_INDEX = NO
+GENERATE_TREEVIEW = YES
+ENUM_VALUES_PER_LINE = 4
+TREEVIEW_WIDTH = 250
+EXT_LINKS_IN_WINDOW = NO
+FORMULA_FONTSIZE = 10
+FORMULA_TRANSPARENT = YES
+USE_MATHJAX = YES
+MATHJAX_FORMAT = HTML-CSS
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+MATHJAX_EXTENSIONS =
+MATHJAX_CODEFILE =
+SEARCHENGINE = YES
+SERVER_BASED_SEARCH = NO
+EXTERNAL_SEARCH = NO
+SEARCHENGINE_URL =
+SEARCHDATA_FILE = searchdata.xml
+EXTERNAL_SEARCH_ID =
+EXTRA_SEARCH_MAPPINGS =
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = YES
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4
+EXTRA_PACKAGES =
+LATEX_HEADER =
+LATEX_FOOTER =
+LATEX_EXTRA_STYLESHEET =
+LATEX_EXTRA_FILES =
+PDF_HYPERLINKS = YES
+USE_PDFLATEX = YES
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+LATEX_SOURCE_CODE = NO
+LATEX_BIB_STYLE = plain
+LATEX_TIMESTAMP = YES
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+RTF_SOURCE_CODE = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_SUBDIR =
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+GENERATE_DOCBOOK = NO
+DOCBOOK_OUTPUT = docbook
+DOCBOOK_PROGRAMLISTING = NO
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED = TYPE_RC:=2 TYPE_COMPLEX:=2
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+EXTERNAL_PAGES = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+MSCGEN_PATH =
+DIA_PATH =
+HIDE_UNDOC_RELATIONS = NO
+HAVE_DOT = @DOXYGEN_DOT_FOUND@
+DOT_NUM_THREADS = 0
+DOT_FONTNAME = Helvetica
+DOT_FONTSIZE = 10
+DOT_FONTPATH =
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+GROUP_GRAPHS = YES
+UML_LOOK = YES
+UML_LIMIT_NUM_FIELDS = 100
+TEMPLATE_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+CALLER_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = svg
+INTERACTIVE_SVG = NO
+DOT_PATH = @DOXYGEN_DOT_EXECUTABLE@
+DOTFILE_DIRS =
+MSCFILE_DIRS =
+DIAFILE_DIRS =
+PLANTUML_JAR_PATH =
+PLANTUML_INCLUDE_PATH =
+DOT_GRAPH_MAX_NODES = 50
+MAX_DOT_GRAPH_DEPTH = 0
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
diff --git a/doc/getting_started.dox b/doc/getting_started.dox
deleted file mode 100644
index acdea7549..000000000
--- a/doc/getting_started.dox
+++ /dev/null
@@ -1,7 +0,0 @@
-/** \file
-
-\getting_started
-
-
-*/
-
diff --git a/doc/mainpage.dox b/doc/mainpage.dox
index 6b0ca6a99..673a98927 100644
--- a/doc/mainpage.dox
+++ b/doc/mainpage.dox
@@ -2,12 +2,7 @@
\mainpage
-These pages serve as the main programmer's reference manual for PHiLiP and were automatically generated from the
-source using Doxygen.
-
-
-A good place to start is the Getting Started page, which provides a getting started
-file which contains detailed instructions for building your understanding of the implementation.
+These pages serve as the main programmer's reference manual for PHiLiP and were automatically generated from the source using Doxygen.
The project home contains
additional information relating to the code functionality and status.
diff --git a/passing_tests.log b/passing_tests.log
new file mode 100644
index 000000000..e76d54fff
--- /dev/null
+++ b/passing_tests.log
@@ -0,0 +1,232 @@
+2019/10/22 fb80cd060f51fdf69034fe4f9b2ee7a5652eb5bb
+
+Test project /home/ddong/Codes/PHiLiP/build_release
+ Start 1: 1D_numerical_flux_conservation
+ 1/53 Test #1: 1D_numerical_flux_conservation ......................................... Passed 0.57 sec
+ Start 2: 2D_numerical_flux_conservation
+ 2/53 Test #2: 2D_numerical_flux_conservation ......................................... Passed 0.44 sec
+ Start 3: 3D_numerical_flux_conservation
+ 3/53 Test #3: 3D_numerical_flux_conservation ......................................... Passed 0.43 sec
+ Start 4: 1D_jacobian_matrix_regression
+ 4/53 Test #4: 1D_jacobian_matrix_regression .......................................... Passed 0.50 sec
+ Start 5: 2D_jacobian_matrix_regression
+ 5/53 Test #5: 2D_jacobian_matrix_regression .......................................... Passed 0.54 sec
+ Start 6: 3D_jacobian_matrix_regression
+ 6/53 Test #6: 3D_jacobian_matrix_regression .......................................... Passed 2.68 sec
+ Start 7: 1D_euler_convert_primitive_conservative
+ 7/53 Test #7: 1D_euler_convert_primitive_conservative ................................ Passed 0.22 sec
+ Start 8: 2D_euler_convert_primitive_conservative
+ 8/53 Test #8: 2D_euler_convert_primitive_conservative ................................ Passed 0.22 sec
+ Start 9: 3D_euler_convert_primitive_conservative
+ 9/53 Test #9: 3D_euler_convert_primitive_conservative ................................ Passed 0.65 sec
+ Start 10: 1D_euler_manufactured_solution_source
+10/53 Test #10: 1D_euler_manufactured_solution_source .................................. Passed 0.21 sec
+ Start 11: 2D_euler_manufactured_solution_source
+11/53 Test #11: 2D_euler_manufactured_solution_source .................................. Passed 0.23 sec
+ Start 12: 3D_euler_manufactured_solution_source
+12/53 Test #12: 3D_euler_manufactured_solution_source .................................. Passed 0.72 sec
+ Start 13: 1D_euler_convective_jacobian
+13/53 Test #13: 1D_euler_convective_jacobian ........................................... Passed 0.23 sec
+ Start 14: 2D_euler_convective_jacobian
+14/53 Test #14: 2D_euler_convective_jacobian ........................................... Passed 0.25 sec
+ Start 15: 3D_euler_convective_jacobian
+15/53 Test #15: 3D_euler_convective_jacobian ........................................... Passed 1.41 sec
+ Start 16: 2D_HighOrder_MappingFEField
+16/53 Test #16: 2D_HighOrder_MappingFEField ............................................ Passed 0.65 sec
+ Start 17: 3D_HighOrder_MappingFEField
+17/53 Test #17: 3D_HighOrder_MappingFEField ............................................ Passed 4.54 sec
+ Start 18: 2D_RBF_mesh_movement
+18/53 Test #18: 2D_RBF_mesh_movement ................................................... Passed 0.63 sec
+ Start 19: 3D_RBF_mesh_movement
+19/53 Test #19: 3D_RBF_mesh_movement ................................................... Passed 2.06 sec
+ Start 20: 2D_make_cells_valid
+20/53 Test #20: 2D_make_cells_valid .................................................... Passed 0.63 sec
+ Start 21: 1D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION
+21/53 Test #21: 1D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION ............................ Passed 0.53 sec
+ Start 22: 2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION
+22/53 Test #22: 2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION ............................ Passed 3.72 sec
+ Start 23: MPI_2D_ADVECTION_EXPLICIT_MANUFACTURED_SOLUTION_LONG
+23/53 Test #23: MPI_2D_ADVECTION_EXPLICIT_MANUFACTURED_SOLUTION_LONG ................... Passed 136.48 sec
+ Start 24: MPI_2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION
+24/53 Test #24: MPI_2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION ........................ Passed 2.71 sec
+ Start 25: MPI_3D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION
+25/53 Test #25: MPI_3D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION ........................ Passed 11.19 sec
+ Start 26: 1D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG
+26/53 Test #26: 1D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG ..................... Passed 0.58 sec
+ Start 27: 2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG
+27/53 Test #27: 2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG ..................... Passed 6.27 sec
+ Start 28: MPI_3D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG_MEDIUM
+28/53 Test #28: MPI_3D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG_MEDIUM .......... Passed 35.05 sec
+ Start 29: 1D_ADVECTION_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION
+29/53 Test #29: 1D_ADVECTION_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION ................. Passed 0.62 sec
+ Start 30: 1D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION
+30/53 Test #30: 1D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION ............................ Passed 0.59 sec
+ Start 31: 2D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION
+31/53 Test #31: 2D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION ............................ Passed 1.64 sec
+ Start 32: MPI_3D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM
+32/53 Test #32: MPI_3D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM ................. Passed 42.64 sec
+ Start 33: 1D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION
+33/53 Test #33: 1D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION ................. Passed 0.67 sec
+ Start 34: 2D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION
+34/53 Test #34: 2D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION ................. Passed 1.73 sec
+ Start 35: 2D_CONVECTION_DIFFUSION_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION
+35/53 Test #35: 2D_CONVECTION_DIFFUSION_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION ...... Passed 1.80 sec
+ Start 36: MPI_3D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM
+36/53 Test #36: MPI_3D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM ...... Passed 40.54 sec
+ Start 37: 1D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION
+37/53 Test #37: 1D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION .............. Passed 0.68 sec
+ Start 38: 2D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION
+38/53 Test #38: 2D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION .............. Passed 9.39 sec
+ Start 39: MPI_3D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM
+39/53 Test #39: MPI_3D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM ... Passed 16.11 sec
+ Start 40: 1D_BURGERS_INVISCID_IMPLICIT_MANUFACTURED_SOLUTION
+40/53 Test #40: 1D_BURGERS_INVISCID_IMPLICIT_MANUFACTURED_SOLUTION ..................... Passed 0.65 sec
+ Start 41: 1D_BURGERS_INVISCID_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION
+41/53 Test #41: 1D_BURGERS_INVISCID_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION .......... Passed 0.61 sec
+ Start 42: 1D_burgers_stability_LONG
+42/53 Test #42: 1D_burgers_stability_LONG .............................................. Passed 198.05 sec
+ Start 43: MPI_3D_EULER_SPLIT_TAYLOR_GREEN
+43/53 Test #43: MPI_3D_EULER_SPLIT_TAYLOR_GREEN ........................................***Failed 0.98 sec
+ Start 44: MPI_2D_ADVECTION_EXPLICIT_PERIODIC_LONG
+44/53 Test #44: MPI_2D_ADVECTION_EXPLICIT_PERIODIC_LONG ................................ Passed 24.06 sec
+ Start 45: 1D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION
+45/53 Test #45: 1D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION ........................... Passed 0.94 sec
+ Start 46: 1D_EULER_LAXFRIEDRICHS_COLLOCATED_MANUFACTURED_SOLUTION
+46/53 Test #46: 1D_EULER_LAXFRIEDRICHS_COLLOCATED_MANUFACTURED_SOLUTION ................ Passed 0.91 sec
+ Start 47: 2D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION_LONG
+47/53 Test #47: 2D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION_LONG ...................... Passed 27.95 sec
+ Start 48: 2D_EULER_LAXFRIEDRICHS_COLLOCATED_MANUFACTURED_SOLUTION
+48/53 Test #48: 2D_EULER_LAXFRIEDRICHS_COLLOCATED_MANUFACTURED_SOLUTION ................***Failed 35.32 sec
+ Start 49: MPI_2D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION_MEDIUM
+49/53 Test #49: MPI_2D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION_MEDIUM ................ Passed 11.77 sec
+ Start 50: 1D_EULER_ROE_MANUFACTURED_SOLUTION_LONG
+50/53 Test #50: 1D_EULER_ROE_MANUFACTURED_SOLUTION_LONG ................................ Passed 0.91 sec
+ Start 51: MPI_2D_EULER_ROE_MANUFACTURED_SOLUTION_MEDIUM
+51/53 Test #51: MPI_2D_EULER_ROE_MANUFACTURED_SOLUTION_MEDIUM .......................... Passed 10.06 sec
+ Start 52: MPI_2D_EULER_INTEGRATION_CYLINDER_LONG
+52/53 Test #52: MPI_2D_EULER_INTEGRATION_CYLINDER_LONG ................................. Passed 224.97 sec
+ Start 53: MPI_2D_EULER_INTEGRATION_GAUSSIAN_BUMP_LONG
+53/53 Test #53: MPI_2D_EULER_INTEGRATION_GAUSSIAN_BUMP_LONG ............................ Passed 707.42 sec
+
+96% tests passed, 2 tests failed out of 53
+
+Total Test time (real) = 1576.04 sec
+
+The following tests FAILED:
+ 43 - MPI_3D_EULER_SPLIT_TAYLOR_GREEN (Failed)
+ 48 - 2D_EULER_LAXFRIEDRICHS_COLLOCATED_MANUFACTURED_SOLUTION (Failed)
+Errors while running CTest
+
+2019/10/08 1a3972a
+
+Test project /home/ddong/Codes/PHiLiP/build_release
+ Start 1: 1D_numerical_flux_conservation
+ 1/50 Test #1: 1D_numerical_flux_conservation ......................................... Passed 0.57 sec
+ Start 2: 2D_numerical_flux_conservation
+ 2/50 Test #2: 2D_numerical_flux_conservation ......................................... Passed 0.42 sec
+ Start 3: 3D_numerical_flux_conservation
+ 3/50 Test #3: 3D_numerical_flux_conservation ......................................... Passed 0.43 sec
+ Start 4: 1D_jacobian_matrix_regression
+ 4/50 Test #4: 1D_jacobian_matrix_regression .......................................... Passed 0.48 sec
+ Start 5: 2D_jacobian_matrix_regression
+ 5/50 Test #5: 2D_jacobian_matrix_regression .......................................... Passed 0.53 sec
+ Start 6: 3D_jacobian_matrix_regression
+ 6/50 Test #6: 3D_jacobian_matrix_regression .......................................... Passed 2.77 sec
+ Start 7: 1D_euler_convert_primitive_conservative
+ 7/50 Test #7: 1D_euler_convert_primitive_conservative ................................ Passed 0.22 sec
+ Start 8: 2D_euler_convert_primitive_conservative
+ 8/50 Test #8: 2D_euler_convert_primitive_conservative ................................ Passed 0.21 sec
+ Start 9: 3D_euler_convert_primitive_conservative
+ 9/50 Test #9: 3D_euler_convert_primitive_conservative ................................ Passed 0.65 sec
+ Start 10: 1D_euler_manufactured_solution_source
+10/50 Test #10: 1D_euler_manufactured_solution_source .................................. Passed 0.19 sec
+ Start 11: 2D_euler_manufactured_solution_source
+11/50 Test #11: 2D_euler_manufactured_solution_source .................................. Passed 0.22 sec
+ Start 12: 3D_euler_manufactured_solution_source
+12/50 Test #12: 3D_euler_manufactured_solution_source .................................. Passed 0.70 sec
+ Start 13: 1D_euler_convective_jacobian
+13/50 Test #13: 1D_euler_convective_jacobian ........................................... Passed 0.20 sec
+ Start 14: 2D_euler_convective_jacobian
+14/50 Test #14: 2D_euler_convective_jacobian ........................................... Passed 0.23 sec
+ Start 15: 3D_euler_convective_jacobian
+15/50 Test #15: 3D_euler_convective_jacobian ........................................... Passed 1.44 sec
+ Start 16: 2D_HighOrder_MappingFEField
+16/50 Test #16: 2D_HighOrder_MappingFEField ............................................ Passed 0.59 sec
+ Start 17: 3D_HighOrder_MappingFEField
+17/50 Test #17: 3D_HighOrder_MappingFEField ............................................ Passed 2.70 sec
+ Start 18: 1D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION
+18/50 Test #18: 1D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION ............................ Passed 0.65 sec
+ Start 19: 2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION
+19/50 Test #19: 2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION ............................ Passed 3.63 sec
+ Start 20: MPI_2D_ADVECTION_EXPLICIT_MANUFACTURED_SOLUTION_LONG
+20/50 Test #20: MPI_2D_ADVECTION_EXPLICIT_MANUFACTURED_SOLUTION_LONG ................... Passed 133.17 sec
+ Start 21: MPI_2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION
+21/50 Test #21: MPI_2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION ........................ Passed 2.28 sec
+ Start 22: MPI_3D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION
+22/50 Test #22: MPI_3D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION ........................ Passed 9.68 sec
+ Start 23: 1D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG
+23/50 Test #23: 1D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG ..................... Passed 0.55 sec
+ Start 24: 2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG
+24/50 Test #24: 2D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG ..................... Passed 5.86 sec
+ Start 25: MPI_3D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG_MEDIUM
+25/50 Test #25: MPI_3D_ADVECTION_IMPLICIT_MANUFACTURED_SOLUTION_STRONG_MEDIUM .......... Passed 29.90 sec
+ Start 26: 1D_ADVECTION_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION
+26/50 Test #26: 1D_ADVECTION_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION ................. Passed 0.54 sec
+ Start 27: 1D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION
+27/50 Test #27: 1D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION ............................ Passed 0.51 sec
+ Start 28: 2D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION
+28/50 Test #28: 2D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION ............................ Passed 1.47 sec
+ Start 29: MPI_3D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM
+29/50 Test #29: MPI_3D_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM ................. Passed 31.92 sec
+ Start 30: 1D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION
+30/50 Test #30: 1D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION ................. Passed 0.54 sec
+ Start 31: 2D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION
+31/50 Test #31: 2D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION ................. Passed 1.52 sec
+ Start 32: 2D_CONVECTION_DIFFUSION_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION
+32/50 Test #32: 2D_CONVECTION_DIFFUSION_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION ...... Passed 1.51 sec
+ Start 33: MPI_3D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM
+33/50 Test #33: MPI_3D_CONVECTION_DIFFUSION_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM ...... Passed 30.37 sec
+ Start 34: 1D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION
+34/50 Test #34: 1D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION .............. Passed 0.57 sec
+ Start 35: 2D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION
+35/50 Test #35: 2D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION .............. Passed 7.53 sec
+ Start 36: MPI_3D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM
+36/50 Test #36: MPI_3D_ADVECTION_VECTOR_VALUED_IMPLICIT_MANUFACTURED_SOLUTION_MEDIUM ... Passed 13.56 sec
+ Start 37: 1D_BURGERS_INVISCID_IMPLICIT_MANUFACTURED_SOLUTION
+37/50 Test #37: 1D_BURGERS_INVISCID_IMPLICIT_MANUFACTURED_SOLUTION ..................... Passed 0.60 sec
+ Start 38: 1D_BURGERS_INVISCID_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION
+38/50 Test #38: 1D_BURGERS_INVISCID_IMPLICIT_COLLOCATED_MANUFACTURED_SOLUTION .......... Passed 0.50 sec
+ Start 39: 1D_burgers_stability_LONG
+39/50 Test #39: 1D_burgers_stability_LONG .............................................. Passed 186.27 sec
+ Start 40: MPI_3D_EULER_SPLIT_TAYLOR_GREEN
+40/50 Test #40: MPI_3D_EULER_SPLIT_TAYLOR_GREEN ........................................***Failed 0.99 sec
+ Start 41: MPI_2D_ADVECTION_EXPLICIT_PERIODIC_LONG
+41/50 Test #41: MPI_2D_ADVECTION_EXPLICIT_PERIODIC_LONG ................................ Passed 24.51 sec
+ Start 42: 1D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION
+42/50 Test #42: 1D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION ........................... Passed 0.95 sec
+ Start 43: 1D_EULER_LAXFRIEDRICHS_COLLOCATED_MANUFACTURED_SOLUTION
+43/50 Test #43: 1D_EULER_LAXFRIEDRICHS_COLLOCATED_MANUFACTURED_SOLUTION ................ Passed 0.91 sec
+ Start 44: 2D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION_LONG
+44/50 Test #44: 2D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION_LONG ...................... Passed 27.54 sec
+ Start 45: 2D_EULER_LAXFRIEDRICHS_COLLOCATED_MANUFACTURED_SOLUTION
+45/50 Test #45: 2D_EULER_LAXFRIEDRICHS_COLLOCATED_MANUFACTURED_SOLUTION ................***Failed 28.02 sec
+ Start 46: MPI_2D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION_MEDIUM
+46/50 Test #46: MPI_2D_EULER_LAXFRIEDRICHS_MANUFACTURED_SOLUTION_MEDIUM ................ Passed 12.20 sec
+ Start 47: 1D_EULER_ROE_MANUFACTURED_SOLUTION_LONG
+47/50 Test #47: 1D_EULER_ROE_MANUFACTURED_SOLUTION_LONG ................................ Passed 0.97 sec
+ Start 48: MPI_2D_EULER_ROE_MANUFACTURED_SOLUTION_MEDIUM
+48/50 Test #48: MPI_2D_EULER_ROE_MANUFACTURED_SOLUTION_MEDIUM .......................... Passed 8.93 sec
+ Start 49: MPI_2D_EULER_INTEGRATION_CYLINDER_LONG
+49/50 Test #49: MPI_2D_EULER_INTEGRATION_CYLINDER_LONG ................................. Passed 213.84 sec
+ Start 50: MPI_2D_EULER_INTEGRATION_GAUSSIAN_BUMP_LONG
+50/50 Test #50: MPI_2D_EULER_INTEGRATION_GAUSSIAN_BUMP_LONG ............................ Passed 653.68 sec
+
+96% tests passed, 2 tests failed out of 50
+
+Total Test time (real) = 1448.91 sec
+
+The following tests FAILED:
+ 40 - MPI_3D_EULER_SPLIT_TAYLOR_GREEN (Failed)
+ 45 - 2D_EULER_LAXFRIEDRICHS_COLLOCATED_MANUFACTURED_SOLUTION (Failed)
+Errors while running CTest
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 60e30a173..be1ceab53 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,8 +1,6 @@
-#set(PHILIP_SRC
-# grid_study.cpp)
-
set(MAIN_SRC
main.cpp)
+add_subdirectory(dummy)
add_subdirectory(linear_solver)
add_subdirectory(parameters)
add_subdirectory(physics)
@@ -67,46 +65,12 @@ foreach(dim RANGE 1 3)
target_link_libraries(${MAIN_TARGET} ${ParameterLib})
target_link_libraries(${MAIN_TARGET} ${TestsLib})
target_link_libraries(${MAIN_TARGET} m mpi)
- DEAL_II_SETUP_TARGET(${MAIN_TARGET})
+ if(NOT DOC_ONLY)
+ DEAL_II_SETUP_TARGET(${MAIN_TARGET})
+ endif()
unset(MAIN_TARGET)
unset(ParameterLib)
unset(TestsLib)
endforeach()
-
-set(SMALL_TEST testrun)
-set(TARGET ${SMALL_TEST})
-set(SMALL_TEST_SRC
- temporary_test.cpp)
-add_executable(${SMALL_TEST} ${SMALL_TEST_SRC})
-target_link_libraries(${SMALL_TEST} mpi )
-DEAL_II_SETUP_TARGET(${SMALL_TEST})
-message("Adding executable " ${SMALL_TEST} " with files " ${SMALL_TEST_SRC} "\n")
-unset(SMALL_TEST)
-unset(TARGET ${SMALL_TEST})
-
-#set(SMALL_TEST instantiate_vector_ad)
-#set(TARGET ${SMALL_TEST})
-#set(SMALL_TEST_SRC
-# instantiate_vector_ad.cpp)
-#add_executable(${SMALL_TEST} ${SMALL_TEST_SRC})
-#target_link_libraries(${SMALL_TEST} mpi )
-#DEAL_II_SETUP_TARGET(${SMALL_TEST})
-#message("Adding executable " ${SMALL_TEST} " with files " ${SMALL_TEST_SRC} "\n")
-#unset(SMALL_TEST)
-#unset(TARGET ${SMALL_TEST})
-
-set(SMALL_TEST manifoldrun)
-set(TARGET ${SMALL_TEST})
-set(SMALL_TEST_SRC
- test_manifold.cpp)
-
-add_executable(${SMALL_TEST} ${SMALL_TEST_SRC})
-# target_link_libraries(${SMALL_TEST} m mpi)
-
-DEAL_II_SETUP_TARGET(${SMALL_TEST})
-message("Adding executable " ${SMALL_TEST} " with files " ${SMALL_TEST_SRC} "\n")
-
-unset(SMALL_TEST)
-unset(TARGET ${SMALL_TEST})
diff --git a/tests/unit_tests/grid/mapping_manifold.cpp b/src/deprecated/mapping_manifold.cpp
similarity index 100%
rename from tests/unit_tests/grid/mapping_manifold.cpp
rename to src/deprecated/mapping_manifold.cpp
diff --git a/src/dg/CMakeLists.txt b/src/dg/CMakeLists.txt
index 0ceb8abf2..e7324e16d 100644
--- a/src/dg/CMakeLists.txt
+++ b/src/dg/CMakeLists.txt
@@ -1,6 +1,7 @@
set(DG_SOURCE
high_order_grid.cpp
dg.cpp
+ drdx.cpp
weak_dg.cpp
strong_dg.cpp
)
@@ -20,7 +21,9 @@ foreach(dim RANGE 1 3)
target_link_libraries(${DiscontinuousGalerkinLib} ${NumericalFluxLib})
target_link_libraries(${DiscontinuousGalerkinLib} ${PhysicsLib})
# Setup target with deal.II
- DEAL_II_SETUP_TARGET(${DiscontinuousGalerkinLib})
+ if(NOT DOC_ONLY)
+ DEAL_II_SETUP_TARGET(${DiscontinuousGalerkinLib})
+ endif()
unset(DiscontinuousGalerkinLib)
unset(NumericalFluxLib)
diff --git a/src/dg/dg.cpp b/src/dg/dg.cpp
index fcc69a39e..91e25544b 100644
--- a/src/dg/dg.cpp
+++ b/src/dg/dg.cpp
@@ -295,398 +295,262 @@ DGBase::~DGBase ()
// //set_all_cells_fe_degree ( max_degree-min_degree);
// }
-
template
-void DGBase::assemble_residual (const bool compute_dRdW)
+template
+real DGBase::evaluate_penalty_scaling (
+ const DoFCellAccessorType &cell,
+ const int iface,
+ const dealii::hp::FECollection fe_collection) const
{
- right_hand_side = 0;
- if (compute_dRdW) system_matrix = 0;
+ const unsigned int fe_index = cell->active_fe_index();
+ const unsigned int degree = fe_collection[fe_index].tensor_degree();
+ const unsigned int degsq = (degree == 0) ? 1 : degree * (degree+1);
- // For now assume same polynomial degree across domain
- const unsigned int max_dofs_per_cell = dof_handler.get_fe_collection().max_dofs_per_cell();
- std::vector current_dofs_indices(max_dofs_per_cell);
- std::vector neighbor_dofs_indices(max_dofs_per_cell);
+ const unsigned int normal_direction = dealii::GeometryInfo::unit_normal_direction[iface];
+ const real vol_div_facearea = cell->extent_in_direction(normal_direction);
- //dealii::hp::MappingCollection mapping_collection(*(high_order_grid.mapping_fe_field));
- //const dealii::MappingManifold mapping;
- //const dealii::MappingQ mapping(max_degree+1);
- const auto mapping = (*(high_order_grid.mapping_fe_field));
- dealii::hp::MappingCollection mapping_collection(mapping);
-
- dealii::hp::FEValues fe_values_collection_volume (mapping_collection, fe_collection, volume_quadrature_collection, this->volume_update_flags); ///< FEValues of volume.
- dealii::hp::FEFaceValues fe_values_collection_face_int (mapping_collection, fe_collection, face_quadrature_collection, this->face_update_flags); ///< FEValues of interior face.
- dealii::hp::FEFaceValues fe_values_collection_face_ext (mapping_collection, fe_collection, face_quadrature_collection, this->neighbor_face_update_flags); ///< FEValues of exterior face.
- dealii::hp::FESubfaceValues fe_values_collection_subface (mapping_collection, fe_collection, face_quadrature_collection, this->face_update_flags); ///< FEValues of subface.
-
- dealii::hp::FEValues fe_values_collection_volume_lagrange (mapping_collection, fe_collection_lagrange, volume_quadrature_collection, this->volume_update_flags);
-
- unsigned int n_cell_visited = 0;
- unsigned int n_face_visited = 0;
-
- solution.update_ghost_values();
- for (auto current_cell = dof_handler.begin_active(); current_cell != dof_handler.end(); ++current_cell) {
- if (!current_cell->is_locally_owned()) continue;
- n_cell_visited++;
-
- // Current reference element related to this physical cell
- const unsigned int mapping_index = 0;
- const unsigned int fe_index_curr_cell = current_cell->active_fe_index();
- const unsigned int quad_index = fe_index_curr_cell;
- const dealii::FESystem ¤t_fe_ref = fe_collection[fe_index_curr_cell];
- const unsigned int curr_cell_degree = current_fe_ref.tensor_degree();
- const unsigned int n_dofs_curr_cell = current_fe_ref.n_dofs_per_cell();
-
- // Local vector contribution from each cell
- dealii::Vector current_cell_rhs (n_dofs_curr_cell); // Defaults to 0.0 initialization
-
- // Obtain the mapping from local dof indices to global dof indices
- current_dofs_indices.resize(n_dofs_curr_cell);
- current_cell->get_dof_indices (current_dofs_indices);
-
- // fe_values_collection.reinit(current_cell, quad_collection_index, mapping_collection_index, fe_collection_index)
- fe_values_collection_volume.reinit (current_cell, quad_index, mapping_index, fe_index_curr_cell);
- const dealii::FEValues &fe_values_volume = fe_values_collection_volume.get_present_fe_values();
+ const real penalty = degsq / vol_div_facearea;
+ return penalty;
+}
- dealii::TriaIterator> cell_iterator = static_cast> > (current_cell);
- //if (!(all_parameters->use_weak_form)) fe_values_collection_volume_lagrange.reinit (current_cell, quad_index, mapping_index, fe_index_curr_cell);
- fe_values_collection_volume_lagrange.reinit (cell_iterator, quad_index, mapping_index, fe_index_curr_cell);
- const dealii::FEValues &fe_values_lagrange = fe_values_collection_volume_lagrange.get_present_fe_values();
- if ( compute_dRdW ) {
- assemble_volume_terms_implicit (fe_values_volume, current_dofs_indices, current_cell_rhs, fe_values_lagrange);
- } else {
- assemble_volume_terms_explicit (fe_values_volume, current_dofs_indices, current_cell_rhs, fe_values_lagrange);
+template
+template
+bool DGBase::current_cell_should_do_the_work (const DoFCellAccessorType1 ¤t_cell, const DoFCellAccessorType2 &neighbor_cell) const
+{
+ if (neighbor_cell->is_ghost()) {
+ // In the case the neighbor is a ghost cell, we let the processor with the lower rank do the work on that face
+ // We cannot use the cell->index() because the index is relative to the distributed triangulation
+ // Therefore, the cell index of a ghost cell might be different to the physical cell index even if they refer to the same cell
+ return (current_cell->subdomain_id() < neighbor_cell->subdomain_id());
+ } else {
+ // Locally owned neighbor cell
+ Assert(neighbor_cell->is_locally_owned(), dealii::ExcMessage("If not ghost, neighbor should be locally owned."));
+
+ if (current_cell->index() < neighbor_cell->index()) {
+ // Cell with lower index does work
+ return true;
+ } else if (neighbor_cell->index() == current_cell->index()) {
+ // If both cells have same index
+ // See https://www.dealii.org/developer/doxygen/deal.II/classTriaAccessorBase.html#a695efcbe84fefef3e4c93ee7bdb446ad
+ // then cell at the lower level does the work
+ return (current_cell->level() < neighbor_cell->level());
}
+ return false;
+ }
+ Assert(0==1, dealii::ExcMessage("Should not have reached here. Somehow another possible case has not been considered when two cells have the same coarseness."));
+ return false;
+}
- for (unsigned int iface=0; iface < dealii::GeometryInfo::faces_per_cell; ++iface) {
+template
+template
+void DGBase::assemble_cell_residual (
+ const DoFCellAccessorType ¤t_cell,
+ const bool compute_dRdW,
+ dealii::hp::FEValues &fe_values_collection_volume,
+ dealii::hp::FEFaceValues &fe_values_collection_face_int,
+ dealii::hp::FEFaceValues &fe_values_collection_face_ext,
+ dealii::hp::FESubfaceValues &fe_values_collection_subface,
+ dealii::hp::FEValues &fe_values_collection_volume_lagrange,
+ dealii::LinearAlgebra::distributed::Vector &rhs)
+{
+ std::vector current_dofs_indices;
+ std::vector neighbor_dofs_indices;
- auto current_face = current_cell->face(iface);
- auto neighbor_cell = current_cell->neighbor(iface);
+ // Current reference element related to this physical cell
+ const int i_fele = current_cell->active_fe_index();
+ const int i_quad = i_fele;
+ const int i_mapp = 0;
- // See tutorial step-30 for breakdown of 4 face cases
+ const dealii::FESystem ¤t_fe_ref = fe_collection[i_fele];
+ const unsigned int n_dofs_curr_cell = current_fe_ref.n_dofs_per_cell();
- // Case 1:
- // Face at boundary
- if (current_face->at_boundary() && !current_cell->has_periodic_neighbor(iface) ) {
+ // Local vector contribution from each cell
+ dealii::Vector current_cell_rhs (n_dofs_curr_cell); // Defaults to 0.0 initialization
- n_face_visited++;
+ // Obtain the mapping from local dof indices to global dof indices
+ current_dofs_indices.resize(n_dofs_curr_cell);
+ current_cell->get_dof_indices (current_dofs_indices);
- fe_values_collection_face_int.reinit (current_cell, iface, quad_index, mapping_index, fe_index_curr_cell);
+ fe_values_collection_volume.reinit (current_cell, i_quad, i_mapp, i_fele);
+ const dealii::FEValues &fe_values_volume = fe_values_collection_volume.get_present_fe_values();
- if(current_face->at_boundary() && all_parameters->use_periodic_bc == true && dim == 1) //using periodic BCs (for 1d)
- {
- int cell_index = current_cell->index();
- //int cell_index = current_cell->index();
- if (cell_index == 0 && iface == 0)
- {
- fe_values_collection_face_int.reinit(current_cell, iface, quad_index, mapping_index, fe_index_curr_cell);
- neighbor_cell = dof_handler.begin_active();
- for (unsigned int i = 0 ; i < triangulation->n_active_cells() - 1; ++i)
- {
- ++neighbor_cell;
- }
- neighbor_cell->get_dof_indices(neighbor_dofs_indices);
- const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
- const unsigned int quad_index_neigh_cell = fe_index_neigh_cell;
- const unsigned int mapping_index_neigh_cell = 0;
+ dealii::TriaIterator> cell_iterator = static_cast> > (current_cell);
+ //if (!(all_parameters->use_weak_form)) fe_values_collection_volume_lagrange.reinit (current_cell, i_quad, i_mapp, i_fele);
+ fe_values_collection_volume_lagrange.reinit (cell_iterator, i_quad, i_mapp, i_fele);
+ const dealii::FEValues &fe_values_lagrange = fe_values_collection_volume_lagrange.get_present_fe_values();
- fe_values_collection_face_ext.reinit(neighbor_cell,(iface == 1) ? 0 : 1,quad_index_neigh_cell,mapping_index_neigh_cell,fe_index_neigh_cell);
+ if ( compute_dRdW ) {
+ assemble_volume_terms_implicit (fe_values_volume, current_dofs_indices, current_cell_rhs, fe_values_lagrange);
+ } else {
+ assemble_volume_terms_explicit (fe_values_volume, current_dofs_indices, current_cell_rhs, fe_values_lagrange);
+ }
- }
- else if (cell_index == (int) triangulation->n_active_cells() - 1 && iface == 1)
- {
- fe_values_collection_face_int.reinit(current_cell, iface, quad_index, mapping_index, fe_index_curr_cell);
- neighbor_cell = dof_handler.begin_active();
- neighbor_cell->get_dof_indices(neighbor_dofs_indices);
- const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
- const unsigned int quad_index_neigh_cell = fe_index_neigh_cell;
- const unsigned int mapping_index_neigh_cell = 0;
- fe_values_collection_face_ext.reinit(neighbor_cell,(iface == 1) ? 0 : 1, quad_index_neigh_cell, mapping_index_neigh_cell, fe_index_neigh_cell); //not sure how changing the face number would work in dim!=1-dimensions.
- }
+ for (unsigned int iface=0; iface < dealii::GeometryInfo::faces_per_cell; ++iface) {
- //std::cout << "cell " << current_cell->index() << "'s " << iface << "th face has neighbour: " << neighbor_cell->index() << std::endl;
- const int neighbor_face_no = (iface ==1) ? 0:1;
- const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
+ auto current_face = current_cell->face(iface);
+ auto neighbor_cell = current_cell->neighbor(iface);
- const dealii::FEFaceValues &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
- const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
+ // Case 1: Face at boundary
+ if (current_face->at_boundary() && !current_cell->has_periodic_neighbor(iface) ) {
- const dealii::FESystem &neigh_fe_ref = fe_collection[fe_index_neigh_cell];
- const unsigned int neigh_cell_degree = neigh_fe_ref.tensor_degree();
- const unsigned int n_dofs_neigh_cell = neigh_fe_ref.n_dofs_per_cell();
+ fe_values_collection_face_int.reinit(current_cell, iface, i_quad, i_mapp, i_fele);
- dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
+ // Case 1.1: 1D Periodic boundary condition
+ if(current_face->at_boundary() && all_parameters->use_periodic_bc == true && dim == 1) {
+ const int neighbor_iface = (iface == 1) ? 0 : 1;
- const unsigned int normal_direction1 = dealii::GeometryInfo::unit_normal_direction[iface];
- const unsigned int normal_direction2 = dealii::GeometryInfo::unit_normal_direction[neighbor_face_no];
- const unsigned int deg1sq = (curr_cell_degree == 0) ? 1 : curr_cell_degree * (curr_cell_degree+1);
- const unsigned int deg2sq = (neigh_cell_degree == 0) ? 1 : neigh_cell_degree * (neigh_cell_degree+1);
+ int cell_index = current_cell->index();
+ if (cell_index == 0 && iface == 0) {
+ // First cell of the domain, neighbor is the last.
+ neighbor_cell = dof_handler.begin_active();
+ for (unsigned int i = 0 ; i < triangulation->n_active_cells() - 1; ++i) {
+ ++neighbor_cell;
+ }
+ } else if (cell_index == (int) triangulation->n_active_cells() - 1 && iface == 1) {
+ // Last cell of the domain, neighbor is the first.
+ neighbor_cell = dof_handler.begin_active();
+ }
- //const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1) / current_face->number_of_children();
- const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1);
- const real vol_div_facearea2 = neighbor_cell->extent_in_direction(normal_direction2);
+ const int i_fele_n = neighbor_cell->active_fe_index(), i_quad_n = i_fele_n, i_mapp_n = 0;
+ const unsigned int n_dofs_neigh_cell = fe_collection[i_fele_n].n_dofs_per_cell();
+ neighbor_dofs_indices.resize(n_dofs_neigh_cell);
+ fe_values_collection_face_ext.reinit(neighbor_cell, neighbor_iface, i_quad_n, i_mapp_n, i_fele_n);
- const real penalty1 = deg1sq / vol_div_facearea1;
- const real penalty2 = deg2sq / vol_div_facearea2;
+ const dealii::FEFaceValues &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
+ const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
- real penalty = 0.5 * ( penalty1 + penalty2 );
+ dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
- if ( compute_dRdW ) {
- assemble_face_term_implicit (
- fe_values_face_int, fe_values_face_ext,
- penalty,
- current_dofs_indices, neighbor_dofs_indices,
- current_cell_rhs, neighbor_cell_rhs);
- } else {
- assemble_face_term_explicit (
- fe_values_face_int, fe_values_face_ext,
- penalty,
- current_dofs_indices, neighbor_dofs_indices,
- current_cell_rhs, neighbor_cell_rhs);
- }
+ const real penalty1 = evaluate_penalty_scaling (current_cell, iface, fe_collection);
+ const real penalty2 = evaluate_penalty_scaling (neighbor_cell, neighbor_iface, fe_collection);
+ const real penalty = 0.5 * (penalty1 + penalty2);
+ if ( compute_dRdW ) {
+ assemble_face_term_implicit (
+ fe_values_face_int, fe_values_face_ext,
+ penalty,
+ current_dofs_indices, neighbor_dofs_indices,
+ current_cell_rhs, neighbor_cell_rhs);
} else {
- const dealii::FEFaceValues &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
- const unsigned int deg1sq = (curr_cell_degree == 0) ? 1 : curr_cell_degree * (curr_cell_degree+1);
- const unsigned int normal_direction = dealii::GeometryInfo::unit_normal_direction[iface];
- const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction);
-
- real penalty = deg1sq / vol_div_facearea1;
-
- const unsigned int boundary_id = current_face->boundary_id();
- // Need to somehow get boundary type from the mesh
- if ( compute_dRdW ) {
- assemble_boundary_term_implicit (boundary_id, fe_values_face_int, penalty, current_dofs_indices, current_cell_rhs);
- } else {
- assemble_boundary_term_explicit (boundary_id, fe_values_face_int, penalty, current_dofs_indices, current_cell_rhs);
- }
- }
-
- //CASE 1.5: periodic boundary conditions
- //note that periodicity is not adapted for hp adaptivity yet. this needs to be figured out in the future
- } else if (current_face->at_boundary() && current_cell->has_periodic_neighbor(iface)){
-
- neighbor_cell = current_cell->periodic_neighbor(iface);
- //std::cout << "cell " << current_cell->index() << " at boundary" <index() << std::endl;
-
-
- if (!current_cell->periodic_neighbor_is_coarser(iface) &&
- (neighbor_cell->index() > current_cell->index() ||
- (neighbor_cell->index() == current_cell->index() && current_cell->level() < neighbor_cell->level())
- )
- )
- {
- n_face_visited++;
- Assert (current_cell->periodic_neighbor(iface).state() == dealii::IteratorState::valid, dealii::ExcInternalError());
-
-
- // Corresponding face of the neighbor.
- // e.g. The 4th face of the current cell might correspond to the 3rd face of the neighbor
- const unsigned int neighbor_face_no = current_cell->periodic_neighbor_of_periodic_neighbor(iface);
-
- // Get information about neighbor cell
- const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
- const unsigned int quad_index_neigh_cell = fe_index_neigh_cell;
- const unsigned int mapping_index_neigh_cell = 0;
- const dealii::FESystem &neigh_fe_ref = fe_collection[fe_index_neigh_cell];
- const unsigned int neigh_cell_degree = neigh_fe_ref.tensor_degree();
- const unsigned int n_dofs_neigh_cell = neigh_fe_ref.n_dofs_per_cell();
-
- // Local rhs contribution from neighbor
- dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
-
- // Obtain the mapping from local dof indices to global dof indices for neighbor cell
- neighbor_dofs_indices.resize(n_dofs_neigh_cell);
- neighbor_cell->get_dof_indices (neighbor_dofs_indices);
-
- fe_values_collection_face_int.reinit (current_cell, iface, quad_index, mapping_index, fe_index_curr_cell);
- const dealii::FEFaceValues &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
- fe_values_collection_face_ext.reinit (neighbor_cell, neighbor_face_no, quad_index_neigh_cell, mapping_index_neigh_cell, fe_index_neigh_cell);
- const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
-
- const unsigned int normal_direction1 = dealii::GeometryInfo::unit_normal_direction[iface];
- const unsigned int normal_direction2 = dealii::GeometryInfo::unit_normal_direction[neighbor_face_no];
- const unsigned int deg1sq = (curr_cell_degree == 0) ? 1 : curr_cell_degree * (curr_cell_degree+1);
- const unsigned int deg2sq = (neigh_cell_degree == 0) ? 1 : neigh_cell_degree * (neigh_cell_degree+1);
-
- //const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1) / current_face->number_of_children();
- const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1);
- const real vol_div_facearea2 = neighbor_cell->extent_in_direction(normal_direction2);
-
- const real penalty1 = deg1sq / vol_div_facearea1;
- const real penalty2 = deg2sq / vol_div_facearea2;
-
- real penalty = 0.5 * ( penalty1 + penalty2 );
- //penalty = 1;//99;
-
- if ( compute_dRdW ) {
- assemble_face_term_implicit (
- fe_values_face_int, fe_values_face_ext,
- penalty,
- current_dofs_indices, neighbor_dofs_indices,
- current_cell_rhs, neighbor_cell_rhs);
- } else {
- assemble_face_term_explicit (
- fe_values_face_int, fe_values_face_ext,
- penalty,
- current_dofs_indices, neighbor_dofs_indices,
- current_cell_rhs, neighbor_cell_rhs);
- }
-
- // Add local contribution from neighbor cell to global vector
- for (unsigned int i=0; i &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
- // Case 2:
- // Neighbour is finer occurs if the face has children
- // In this case, we loop over the current large face's subfaces and visit multiple neighbors
- } else if (current_face->has_children()) {
-
- Assert (current_cell->neighbor(iface).state() == dealii::IteratorState::valid, dealii::ExcInternalError());
+ const real penalty = evaluate_penalty_scaling (current_cell, iface, fe_collection);
- // Obtain cell neighbour
- const unsigned int neighbor_face_no = current_cell->neighbor_face_no(iface);
+ const unsigned int boundary_id = current_face->boundary_id();
+ // Need to somehow get boundary type from the mesh
+ if ( compute_dRdW ) {
+ assemble_boundary_term_implicit (boundary_id, fe_values_face_int, penalty, current_dofs_indices, current_cell_rhs);
+ } else {
+ assemble_boundary_term_explicit (boundary_id, fe_values_face_int, penalty, current_dofs_indices, current_cell_rhs);
+ }
+ }
- for (unsigned int subface_no=0; subface_no < current_face->number_of_children(); ++subface_no) {
+ //CASE 1.5: periodic boundary conditions
+ //note that periodicity is not adapted for hp adaptivity yet. this needs to be figured out in the future
+ } else if (current_face->at_boundary() && current_cell->has_periodic_neighbor(iface)){
- n_face_visited++;
+ neighbor_cell = current_cell->periodic_neighbor(iface);
+ //std::cout << "cell " << current_cell->index() << " at boundary" <index() << std::endl;
- // Get neighbor on ith subface
- auto neighbor_cell = current_cell->neighbor_child_on_subface (iface, subface_no);
- // Since the neighbor cell is finer than the current cell, it should not have more children
- Assert (!neighbor_cell->has_children(), dealii::ExcInternalError());
- // Get information about neighbor cell
- const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
- const unsigned int quad_index_neigh_cell = fe_index_neigh_cell;
- const unsigned int mapping_index_neigh_cell = 0;
- const dealii::FESystem &neigh_fe_ref = fe_collection[fe_index_neigh_cell];
- const unsigned int neigh_cell_degree = neigh_fe_ref.tensor_degree();
- const unsigned int n_dofs_neigh_cell = neigh_fe_ref.n_dofs_per_cell();
+ if (!current_cell->periodic_neighbor_is_coarser(iface) && current_cell_should_do_the_work(current_cell, neighbor_cell)) {
- dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
+ Assert (current_cell->periodic_neighbor(iface).state() == dealii::IteratorState::valid, dealii::ExcInternalError());
- // Obtain the mapping from local dof indices to global dof indices for neighbor cell
- neighbor_dofs_indices.resize(n_dofs_neigh_cell);
- neighbor_cell->get_dof_indices (neighbor_dofs_indices);
+ const unsigned int n_dofs_neigh_cell = fe_collection[neighbor_cell->active_fe_index()].n_dofs_per_cell();
+ dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
- fe_values_collection_subface.reinit (current_cell, iface, subface_no, quad_index, mapping_index, fe_index_curr_cell);
- const dealii::FESubfaceValues &fe_values_face_int = fe_values_collection_subface.get_present_fe_values();
+ // Obtain the mapping from local dof indices to global dof indices for neighbor cell
+ neighbor_dofs_indices.resize(n_dofs_neigh_cell);
+ neighbor_cell->get_dof_indices (neighbor_dofs_indices);
- fe_values_collection_face_ext.reinit (neighbor_cell, neighbor_face_no, quad_index_neigh_cell, mapping_index_neigh_cell, fe_index_neigh_cell);
- const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
+ fe_values_collection_face_int.reinit (current_cell, iface, i_quad, i_mapp, i_fele);
+ const dealii::FEFaceValues &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
- const unsigned int normal_direction1 = dealii::GeometryInfo::unit_normal_direction[iface];
- const unsigned int normal_direction2 = dealii::GeometryInfo::unit_normal_direction[neighbor_face_no];
- const unsigned int deg1sq = (curr_cell_degree == 0) ? 1 : curr_cell_degree * (curr_cell_degree+1);
- const unsigned int deg2sq = (neigh_cell_degree == 0) ? 1 : neigh_cell_degree * (neigh_cell_degree+1);
+ // Corresponding face of the neighbor.
+ const unsigned int neighbor_iface = current_cell->periodic_neighbor_of_periodic_neighbor(iface);
- const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1);
- const real vol_div_facearea2 = neighbor_cell->extent_in_direction(normal_direction2);
+ const int i_fele_n = neighbor_cell->active_fe_index(), i_quad_n = i_fele_n, i_mapp_n = 0;
+ fe_values_collection_face_ext.reinit (neighbor_cell, neighbor_iface, i_quad_n, i_mapp_n, i_fele_n);
+ const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
- const real penalty1 = deg1sq / vol_div_facearea1;
- const real penalty2 = deg2sq / vol_div_facearea2;
-
- real penalty = 0.5 * ( penalty1 + penalty2 );
+ const real penalty1 = evaluate_penalty_scaling (current_cell, iface, fe_collection);
+ const real penalty2 = evaluate_penalty_scaling (neighbor_cell, neighbor_iface, fe_collection);
+ const real penalty = 0.5 * (penalty1 + penalty2);
- if ( compute_dRdW ) {
- assemble_face_term_implicit (
- fe_values_face_int, fe_values_face_ext,
- penalty,
- current_dofs_indices, neighbor_dofs_indices,
- current_cell_rhs, neighbor_cell_rhs);
- } else {
- assemble_face_term_explicit (
+ if ( compute_dRdW ) {
+ assemble_face_term_implicit (
+ fe_values_face_int, fe_values_face_ext,
+ penalty,
+ current_dofs_indices, neighbor_dofs_indices,
+ current_cell_rhs, neighbor_cell_rhs);
+ } else {
+ assemble_face_term_explicit (
fe_values_face_int, fe_values_face_ext,
penalty,
current_dofs_indices, neighbor_dofs_indices,
current_cell_rhs, neighbor_cell_rhs);
- }
- // Add local contribution from neighbor cell to global vector
- for (unsigned int i=0; ineighbor_is_coarser(iface))
- // In the case the neighbor is a ghost cell, we let the processor with the lower rank do the work on that face
- // We cannot use the cell->index() because the index is relative to the distributed triangulation
- // Therefore, the cell index of a ghost cell might be different to the physical cell index even if they refer to the same cell
- && neighbor_cell->is_ghost()
- && current_cell->subdomain_id() < neighbor_cell->subdomain_id()
- )
- ||
- ( !(current_cell->neighbor_is_coarser(iface))
- // In the case the neighbor is a local cell, we let the cell with the lower index do the work on that face
- && neighbor_cell->is_locally_owned()
- &&
- ( // Cell with lower index does work
- current_cell->index() < neighbor_cell->index()
- ||
- // If both cells have same index
- // See https://www.dealii.org/developer/doxygen/deal.II/classTriaAccessorBase.html#a695efcbe84fefef3e4c93ee7bdb446ad
- // then cell at the lower level does the work
- (neighbor_cell->index() == current_cell->index() && current_cell->level() < neighbor_cell->level())
- )
- )
- )
- {
- n_face_visited++;
- Assert (current_cell->neighbor(iface).state() == dealii::IteratorState::valid, dealii::ExcInternalError());
+ // Add local contribution from neighbor cell to global vector
+ for (unsigned int i=0; ineighbor_or_periodic_neighbor(iface);
- // Corresponding face of the neighbor.
- // e.g. The 4th face of the current cell might correspond to the 3rd face of the neighbor
- const unsigned int neighbor_face_no = current_cell->neighbor_of_neighbor(iface);
- // Get information about neighbor cell
- const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
- const unsigned int quad_index_neigh_cell = fe_index_neigh_cell;
- const unsigned int mapping_index_neigh_cell = 0;
- const dealii::FESystem &neigh_fe_ref = fe_collection[fe_index_neigh_cell];
- const unsigned int neigh_cell_degree = neigh_fe_ref.tensor_degree();
- const unsigned int n_dofs_neigh_cell = neigh_fe_ref.n_dofs_per_cell();
+ // Case 2:
+ // Neighbour is finer occurs if the face has children
+ // In this case, we loop over the current large face's subfaces and visit multiple neighbors
+ } else if (current_face->has_children()) {
+
+ Assert (current_cell->neighbor(iface).state() == dealii::IteratorState::valid, dealii::ExcInternalError());
+ Assert (current_cell->neighbor(iface)->has_children(), dealii::ExcInternalError());
+
+ // Obtain cell neighbour
+ const unsigned int neighbor_iface = current_cell->neighbor_face_no(iface);
+
+ for (unsigned int subface_no=0; subface_no < current_face->number_of_children(); ++subface_no) {
+
+ // Get neighbor on ith subface
+ auto neighbor_cell = current_cell->neighbor_child_on_subface (iface, subface_no);
+ // Since the neighbor cell is finer than the current cell, it should not have more children
+ Assert (!neighbor_cell->has_children(), dealii::ExcInternalError());
+ Assert (neighbor_cell->neighbor(neighbor_iface) == current_cell, dealii::ExcInternalError());
- // Local rhs contribution from neighbor
- dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
+ const int i_fele_n = neighbor_cell->active_fe_index(), i_quad_n = i_fele_n, i_mapp_n = 0;
+
+ const unsigned int n_dofs_neigh_cell = fe_collection[i_fele_n].n_dofs_per_cell();
+ dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
// Obtain the mapping from local dof indices to global dof indices for neighbor cell
neighbor_dofs_indices.resize(n_dofs_neigh_cell);
neighbor_cell->get_dof_indices (neighbor_dofs_indices);
- fe_values_collection_face_int.reinit (current_cell, iface, quad_index, mapping_index, fe_index_curr_cell);
- const dealii::FEFaceValues &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
- fe_values_collection_face_ext.reinit (neighbor_cell, neighbor_face_no, quad_index_neigh_cell, mapping_index_neigh_cell, fe_index_neigh_cell);
- const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
+ fe_values_collection_subface.reinit (current_cell, iface, subface_no, i_quad, i_mapp, i_fele);
+ const dealii::FESubfaceValues &fe_values_face_int = fe_values_collection_subface.get_present_fe_values();
- const unsigned int normal_direction1 = dealii::GeometryInfo::unit_normal_direction[iface];
- const unsigned int normal_direction2 = dealii::GeometryInfo::unit_normal_direction[neighbor_face_no];
- const unsigned int deg1sq = (curr_cell_degree == 0) ? 1 : curr_cell_degree * (curr_cell_degree+1);
- const unsigned int deg2sq = (neigh_cell_degree == 0) ? 1 : neigh_cell_degree * (neigh_cell_degree+1);
-
- //const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1) / current_face->number_of_children();
- const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1);
- const real vol_div_facearea2 = neighbor_cell->extent_in_direction(normal_direction2);
+ fe_values_collection_face_ext.reinit (neighbor_cell, neighbor_iface, i_quad_n, i_mapp_n, i_fele_n);
+ const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
- const real penalty1 = deg1sq / vol_div_facearea1;
- const real penalty2 = deg2sq / vol_div_facearea2;
-
- real penalty = 0.5 * ( penalty1 + penalty2 );
- //penalty = 1;//99;
+ const real penalty1 = evaluate_penalty_scaling (current_cell, iface, fe_collection);
+ const real penalty2 = evaluate_penalty_scaling (neighbor_cell, neighbor_iface, fe_collection);
+ const real penalty = 0.5 * (penalty1 + penalty2);
if ( compute_dRdW ) {
assemble_face_term_implicit (
@@ -696,29 +560,117 @@ void DGBase::assemble_residual (const bool compute_dRdW)
current_cell_rhs, neighbor_cell_rhs);
} else {
assemble_face_term_explicit (
- fe_values_face_int, fe_values_face_ext,
- penalty,
- current_dofs_indices, neighbor_dofs_indices,
- current_cell_rhs, neighbor_cell_rhs);
+ fe_values_face_int, fe_values_face_ext,
+ penalty,
+ current_dofs_indices, neighbor_dofs_indices,
+ current_cell_rhs, neighbor_cell_rhs);
}
-
// Add local contribution from neighbor cell to global vector
for (unsigned int i=0; ineighbor_is_coarser(iface)) && current_cell_should_do_the_work(current_cell, neighbor_cell) ) {
+ Assert (current_cell->neighbor(iface).state() == dealii::IteratorState::valid, dealii::ExcInternalError());
+
+ auto neighbor_cell = current_cell->neighbor_or_periodic_neighbor(iface);
+ // Corresponding face of the neighbor.
+ // e.g. The 4th face of the current cell might correspond to the 3rd face of the neighbor
+ const unsigned int neighbor_iface = current_cell->neighbor_of_neighbor(iface);
+
+ // Get information about neighbor cell
+ const unsigned int n_dofs_neigh_cell = fe_collection[neighbor_cell->active_fe_index()].n_dofs_per_cell();
+
+ // Local rhs contribution from neighbor
+ dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
+
+ // Obtain the mapping from local dof indices to global dof indices for neighbor cell
+ neighbor_dofs_indices.resize(n_dofs_neigh_cell);
+ neighbor_cell->get_dof_indices (neighbor_dofs_indices);
+
+ fe_values_collection_face_int.reinit (current_cell, iface, i_quad, i_mapp, i_fele);
+ const dealii::FEFaceValues &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
+
+ const int i_fele_n = neighbor_cell->active_fe_index(), i_quad_n = i_fele_n, i_mapp_n = 0;
+ fe_values_collection_face_ext.reinit (neighbor_cell, neighbor_iface, i_quad_n, i_mapp_n, i_fele_n);
+ const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
+
+ const real penalty1 = evaluate_penalty_scaling (current_cell, iface, fe_collection);
+ const real penalty2 = evaluate_penalty_scaling (neighbor_cell, neighbor_iface, fe_collection);
+ const real penalty = 0.5 * (penalty1 + penalty2);
- for (unsigned int i=0; i
+void DGBase::assemble_residual (const bool compute_dRdW)
+{
+ right_hand_side = 0;
+
+ if (compute_dRdW) system_matrix = 0;
+
+ //dealii::hp::MappingCollection mapping_collection(*(high_order_grid.mapping_fe_field));
+ //const dealii::MappingManifold mapping;
+ //const dealii::MappingQ mapping(max_degree+1);
+ const auto mapping = (*(high_order_grid.mapping_fe_field));
+ dealii::hp::MappingCollection mapping_collection(mapping);
+
+ dealii::hp::FEValues fe_values_collection_volume (mapping_collection, fe_collection, volume_quadrature_collection, this->volume_update_flags); ///< FEValues of volume.
+ dealii::hp::FEFaceValues fe_values_collection_face_int (mapping_collection, fe_collection, face_quadrature_collection, this->face_update_flags); ///< FEValues of interior face.
+ dealii::hp::FEFaceValues fe_values_collection_face_ext (mapping_collection, fe_collection, face_quadrature_collection, this->neighbor_face_update_flags); ///< FEValues of exterior face.
+ dealii::hp::FESubfaceValues fe_values_collection_subface (mapping_collection, fe_collection, face_quadrature_collection, this->face_update_flags); ///< FEValues of subface.
+
+ dealii::hp::FEValues fe_values_collection_volume_lagrange (mapping_collection, fe_collection_lagrange, volume_quadrature_collection, this->volume_update_flags);
+
+ solution.update_ghost_values();
+
+ for (auto current_cell = dof_handler.begin_active(); current_cell != dof_handler.end(); ++current_cell) {
+ if (!current_cell->is_locally_owned()) continue;
+
+ // Add right-hand side contributions this cell can compute
+ assemble_cell_residual (current_cell, compute_dRdW,
+ fe_values_collection_volume,
+ fe_values_collection_face_int,
+ fe_values_collection_face_ext,
+ fe_values_collection_subface,
+ fe_values_collection_volume_lagrange,
+ right_hand_side);
} // end of cell loop
+
right_hand_side.compress(dealii::VectorOperation::add);
if ( compute_dRdW ) system_matrix.compress(dealii::VectorOperation::add);
@@ -789,9 +741,9 @@ void DGBase::output_results_vtk (const unsigned int cycle)// const
const int iproc = dealii::Utilities::MPI::this_mpi_process(mpi_communicator);
//data_out.build_patches (mapping_collection[mapping_collection.size()-1]);
- data_out.build_patches(*(high_order_grid.mapping_fe_field), max_degree, dealii::DataOut>::CurvedCellRegion::curved_inner_cells);
+ data_out.build_patches(*(high_order_grid.mapping_fe_field), max_degree, dealii::DataOut>::CurvedCellRegion::no_curved_cells);
//data_out.build_patches(*(high_order_grid.mapping_fe_field), fe_collection.size(), dealii::DataOut::CurvedCellRegion::curved_inner_cells);
- std::string filename = "solution-" + dealii::Utilities::int_to_string(dim, 1) +"D-";
+ std::string filename = "solution-" + dealii::Utilities::int_to_string(dim, 1) +"D_maxpoly"+dealii::Utilities::int_to_string(max_degree, 2)+"-";
filename += dealii::Utilities::int_to_string(cycle, 4) + ".";
filename += dealii::Utilities::int_to_string(iproc, 4);
filename += ".vtu";
@@ -801,13 +753,13 @@ void DGBase::output_results_vtk (const unsigned int cycle)// const
if (iproc == 0) {
std::vector filenames;
for (unsigned int iproc = 0; iproc < dealii::Utilities::MPI::n_mpi_processes(mpi_communicator); ++iproc) {
- std::string fn = "solution-" + dealii::Utilities::int_to_string(dim, 1) +"D-";
+ std::string fn = "solution-" + dealii::Utilities::int_to_string(dim, 1) +"D_maxpoly"+dealii::Utilities::int_to_string(max_degree, 2)+"-";
fn += dealii::Utilities::int_to_string(cycle, 4) + ".";
fn += dealii::Utilities::int_to_string(iproc, 4);
fn += ".vtu";
filenames.push_back(fn);
}
- std::string master_fn = "solution-" + dealii::Utilities::int_to_string(dim, 1) +"D-";
+ std::string master_fn = "solution-" + dealii::Utilities::int_to_string(dim, 1) +"D_maxpoly"+dealii::Utilities::int_to_string(max_degree, 2)+"-";
master_fn += dealii::Utilities::int_to_string(cycle, 4) + ".pvtu";
std::ofstream master_output(master_fn);
data_out.write_pvtu_record(master_output, filenames);
diff --git a/src/dg/dg.h b/src/dg/dg.h
index aeecb0719..528cafa49 100644
--- a/src/dg/dg.h
+++ b/src/dg/dg.h
@@ -67,8 +67,16 @@ template
class DGBase
{
#if PHILIP_DIM==1 // dealii::parallel::distributed::Triangulation does not work for 1D
+ /** Triangulation to store the grid.
+ * In 1D, dealii::Triangulation is used.
+ * In 2D, 3D, dealii::parallel::distributed::Triangulation is used.
+ */
using Triangulation = dealii::Triangulation;
#else
+ /** Triangulation to store the grid.
+ * In 1D, dealii::Triangulation is used.
+ * In 2D, 3D, dealii::parallel::distributed::Triangulation is used.
+ */
using Triangulation = dealii::parallel::distributed::Triangulation;
#endif
public:
@@ -217,6 +225,16 @@ class DGBase
*/
dealii::LinearAlgebra::distributed::Vector solution;
+ /// Evaluate SparsityPattern of dRdX
+ /* Where R represents the residual and X represents the grid degrees of freedom stored as high_order_grid.nodes.
+ */
+ dealii::SparsityPattern get_dRdX_sparsity_pattern ();
+
+ /// Evaluate dRdX using finite-differences
+ /* Where R represents the residual and X represents the grid degrees of freedom stored as high_order_grid.nodes.
+ */
+ dealii::TrilinosWrappers::SparseMatrix get_dRdX_finite_differences (dealii::SparsityPattern dRdX_sparsity_pattern);
+
void initialize_manufactured_solution (); ///< Virtual function defined in DG
void output_results_vtk (const unsigned int ith_grid); ///< Output solution
@@ -256,6 +274,22 @@ class DGBase
//void assemble_residual_dRdW ();
void assemble_residual (const bool compute_dRdW=false);
+ /// Used in assemble_residual().
+ /** IMPORTANT: This does not fully compute the cell residual since it might not
+ * perform the work on all the faces.
+ * All the active cells must be traversed to ensure that the right hand side is correct.
+ */
+ template
+ void assemble_cell_residual (
+ const DoFCellAccessorType ¤t_cell,
+ const bool compute_dRdW,
+ dealii::hp::FEValues &fe_values_collection_volume,
+ dealii::hp::FEFaceValues &fe_values_collection_face_int,
+ dealii::hp::FEFaceValues &fe_values_collection_face_ext,
+ dealii::hp::FESubfaceValues &fe_values_collection_subface,
+ dealii::hp::FEValues &fe_values_collection_volume_lagrange,
+ dealii::LinearAlgebra::distributed::Vector &rhs);
+
/// Finite Element Collection for p-finite-element to represent the solution
/** This is a collection of FESystems */
const dealii::hp::FECollection fe_collection;
@@ -268,8 +302,11 @@ class DGBase
//const dealii::hp::FECollection fe_collection_grid;
//const dealii::FESystem fe_grid;
+ /// Quadrature used to evaluate volume integrals.
dealii::hp::QCollection volume_quadrature_collection;
+ /// Quadrature used to evaluate face integrals.
dealii::hp::QCollection face_quadrature_collection;
+ /// 1D quadrature to generate Lagrange polynomials for the sake of flux interpolation.
dealii::hp::QCollection<1> oned_quadrature_collection;
protected:
@@ -379,7 +416,7 @@ class DGBase
const dealii::UpdateFlags face_update_flags = dealii::update_values | dealii::update_gradients | dealii::update_quadrature_points | dealii::update_JxW_values | dealii::update_normal_vectors;
/// Update flags needed at neighbor' face points.
/** NOTE: With hp-adaptation, might need to query neighbor's quadrature points depending on the order of the cells. */
- const dealii::UpdateFlags neighbor_face_update_flags = dealii::update_values | dealii::update_gradients;
+ const dealii::UpdateFlags neighbor_face_update_flags = dealii::update_values | dealii::update_gradients | dealii::update_quadrature_points | dealii::update_JxW_values;
@@ -388,6 +425,28 @@ class DGBase
dealii::ConditionalOStream pcout; ///< Parallel std::cout that only outputs on mpi_rank==0
private:
+ /// Evaluate the average penalty term at the face
+ /** For a cell with solution of degree p, and Hausdorff measure h,
+ * which represents the element dimension orthogonal to the face,
+ * the penalty term is given by p*(p+1)/h .
+ */
+ template
+ real evaluate_penalty_scaling (
+ const DoFCellAccessorType &cell,
+ const int iface,
+ const dealii::hp::FECollection fe_collection) const;
+
+ /// In the case that two cells have the same coarseness, this function decides if the current cell should perform the work.
+ /** In the case the neighbor is a ghost cell, we let the processor with the lower rank do the work on that face.
+ * We cannot use the cell->index() because the index is relative to the distributed triangulation.
+ * Therefore, the cell index of a ghost cell might be different to the physical cell index even if they refer to the same cell.
+ *
+ * For a locally owned neighbor cell, cell with lower index does work or if both cells have same index, then cell at the lower level does the work
+ * See https://www.dealii.org/developer/doxygen/deal.II/classTriaAccessorBase.html#a695efcbe84fefef3e4c93ee7bdb446ad
+ */
+ template
+ bool current_cell_should_do_the_work (const DoFCellAccessorType1 ¤t_cell, const DoFCellAccessorType2 &neighbor_cell) const;
+
/// Used in the delegated constructor
/** The main reason we use this weird function is because all of the above objects
* need to be looped with the various p-orders. This function allows us to do this in a
@@ -404,22 +463,29 @@ template
class DGWeak : public DGBase
{
#if PHILIP_DIM==1 // dealii::parallel::distributed::Triangulation does not work for 1D
+ /** Triangulation to store the grid.
+ * In 1D, dealii::Triangulation is used.
+ * In 2D, 3D, dealii::parallel::distributed::Triangulation is used.
+ */
using Triangulation = dealii::Triangulation;
#else
+ /** Triangulation to store the grid.
+ * In 1D, dealii::Triangulation is used.
+ * In 2D, 3D, dealii::parallel::distributed::Triangulation is used.
+ */
using Triangulation = dealii::parallel::distributed::Triangulation;
#endif
public:
- /// Constructor
+ /// Constructor.
DGWeak(
const Parameters::AllParameters *const parameters_input,
const unsigned int degree,
Triangulation *const triangulation_input);
- ~DGWeak(); ///< Destructor
+ ~DGWeak(); ///< Destructor.
private:
-
/// Contains the physics of the PDE
std::shared_ptr < Physics::PhysicsBase > > pde_physics;
/// Convective numerical flux
@@ -497,8 +563,16 @@ template
class DGStrong : public DGBase
{
#if PHILIP_DIM==1 // dealii::parallel::distributed::Triangulation does not work for 1D
+ /** Triangulation to store the grid.
+ * In 1D, dealii::Triangulation is used.
+ * In 2D, 3D, dealii::parallel::distributed::Triangulation is used.
+ */
using Triangulation = dealii::Triangulation;
#else
+ /** Triangulation to store the grid.
+ * In 1D, dealii::Triangulation is used.
+ * In 2D, 3D, dealii::parallel::distributed::Triangulation is used.
+ */
using Triangulation = dealii::parallel::distributed::Triangulation;
#endif
public:
@@ -591,8 +665,16 @@ template
class DGFactory
{
#if PHILIP_DIM==1 // dealii::parallel::distributed::Triangulation does not work for 1D
+ /** Triangulation to store the grid.
+ * In 1D, dealii::Triangulation is used.
+ * In 2D, 3D, dealii::parallel::distributed::Triangulation is used.
+ */
using Triangulation = dealii::Triangulation;
#else
+ /** Triangulation to store the grid.
+ * In 1D, dealii::Triangulation is used.
+ * In 2D, 3D, dealii::parallel::distributed::Triangulation is used.
+ */
using Triangulation = dealii::parallel::distributed::Triangulation;
#endif
public:
diff --git a/src/dg/drdx.cpp b/src/dg/drdx.cpp
new file mode 100644
index 000000000..2ba3922f1
--- /dev/null
+++ b/src/dg/drdx.cpp
@@ -0,0 +1,447 @@
+#include "dg.h"
+
+namespace PHiLiP {
+
+template
+dealii::SparsityPattern DGBase::get_dRdX_sparsity_pattern () {
+
+ const unsigned n_residuals = dof_handler.n_dofs();
+ const unsigned n_nodes_coeff = high_order_grid.dof_handler_grid.n_dofs();
+ const unsigned n_nodes_per_cell = high_order_grid.dof_handler_grid.get_fe_collection().max_dofs_per_cell();
+ dealii::SparsityPattern sparsity_pattern(n_residuals, n_nodes_coeff, n_nodes_per_cell);
+
+ std::vector resi_indices;
+ std::vector node_indices;
+ for (auto cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell) {
+ if (!cell->is_locally_owned()) continue;
+
+ const unsigned int level = cell->level();
+ const unsigned int index = cell->index();
+
+ const unsigned int n_resi_cell = fe_collection[cell->active_fe_index()].n_dofs_per_cell();
+ resi_indices.resize(n_resi_cell);
+ cell->get_dof_indices (resi_indices);
+
+ for (auto cell_grid = high_order_grid.dof_handler_grid.begin_active(); cell_grid != dof_handler.end(); ++cell_grid) {
+ // Brute force search for the same cell.
+ // There must be a better way
+ if (!cell_grid->is_locally_owned()) continue;
+ if (cell_grid->level() != level) continue;
+ if (cell_grid->index() != index) continue;
+
+ const unsigned int n_node_cell = high_order_grid.fe_system.n_dofs_per_cell();
+ node_indices.resize(n_node_cell);
+ cell_grid->get_dof_indices (node_indices);
+
+ for (auto resi_row = resi_indices.begin(); resi_row!=resi_indices.end(); ++resi_row) {
+ sparsity_pattern.add_entries(*resi_row, node_indices.begin(), node_indices.end());
+ }
+
+ break;
+ }
+
+ } // end of cell loop
+ sparsity_pattern.compress();
+
+ return sparsity_pattern;
+}
+
+//template
+//dealii::TrilinosWrappers::SparseMatrix DGBase::get_dRdX_finite_differences (dealii::SparsityPattern dRdX_sparsity_pattern) {
+//
+// const double pertubation = 1e-8;
+//
+// dealii::TrilinosWrappers::SparseMatrix dRdX;
+// dRdX.reinit(locally_owned_dofs, dRdX_sparsity_pattern, mpi_communicator);
+//
+// // For now assume same polynomial degree across domain
+// const unsigned int max_dofs_per_cell = dof_handler.get_fe_collection().max_dofs_per_cell();
+// std::vector current_dofs_indices(max_dofs_per_cell);
+// std::vector neighbor_dofs_indices(max_dofs_per_cell);
+//
+// for (auto current_cell = dof_handler.begin_active(); current_cell != dof_handler.end(); ++current_cell) {
+// if (!current_cell->is_locally_owned()) continue;
+//
+//
+// // Current reference element related to this physical cell
+// const unsigned int mapping_index = 0;
+// const unsigned int fe_index_curr_cell = current_cell->active_fe_index();
+// const unsigned int quad_index = fe_index_curr_cell;
+// const dealii::FESystem ¤t_fe_ref = fe_collection[fe_index_curr_cell];
+// const unsigned int curr_cell_degree = current_fe_ref.tensor_degree();
+// const unsigned int n_dofs_curr_cell = current_fe_ref.n_dofs_per_cell();
+//
+// // Local vector contribution from each cell
+// dealii::Vector current_cell_rhs (n_dofs_curr_cell); // Defaults to 0.0 initialization
+//
+// // Obtain the mapping from local dof indices to global dof indices
+// current_dofs_indices.resize(n_dofs_curr_cell);
+// current_cell->get_dof_indices (current_dofs_indices);
+//
+//
+// // Cell diameter used to scale perturbation
+// double cell_diameter = current_cell.diameter();
+// for (auto resi_row = current_dofs_indices.begin(); resi_row != current_dofs_indices.end(); ++resi_row) {
+// const int irow_glob = *resi_row;
+// const int n_cols = dRdX_sparsity_pattern.row_length(irow_glob);
+// for (int icol=0; icol < n_cols; ++icol) {
+// const int icol_glob = dRdX_sparsity_pattern.column_number(irow_glob, icol);
+//
+// double old_node = high_order_grid.nodes[icol_glob];
+// double dx = cell_diameter * perturbation;
+// double high_order_grid.nodes[icol_glob] += dx;
+// high_order_grid.nodes.update_ghost_values();
+//
+// double high_order_grid.nodes[icol_glob] = old_node;
+// high_order_grid.nodes.update_ghost_values();
+// }
+// }
+//
+// //dealii::hp::MappingCollection mapping_collection(*(high_order_grid.mapping_fe_field));
+// //const dealii::MappingManifold mapping;
+// //const dealii::MappingQ mapping(max_degree+1);
+// const auto mapping = (*(high_order_grid.mapping_fe_field));
+// dealii::hp::MappingCollection mapping_collection(mapping);
+//
+// dealii::hp::FEValues fe_values_collection_volume (mapping_collection, fe_collection, volume_quadrature_collection, this->volume_update_flags); ///< FEValues of volume.
+// dealii::hp::FEFaceValues fe_values_collection_face_int (mapping_collection, fe_collection, face_quadrature_collection, this->face_update_flags); ///< FEValues of interior face.
+// dealii::hp::FEFaceValues fe_values_collection_face_ext (mapping_collection, fe_collection, face_quadrature_collection, this->neighbor_face_update_flags); ///< FEValues of exterior face.
+// dealii::hp::FESubfaceValues fe_values_collection_subface (mapping_collection, fe_collection, face_quadrature_collection, this->face_update_flags); ///< FEValues of subface.
+//
+// dealii::hp::FEValues fe_values_collection_volume_lagrange (mapping_collection, fe_collection_lagrange, volume_quadrature_collection, this->volume_update_flags);
+//
+// // fe_values_collection.reinit(current_cell, quad_collection_index, mapping_collection_index, fe_collection_index)
+// fe_values_collection_volume.reinit (current_cell, quad_index, mapping_index, fe_index_curr_cell);
+// const dealii::FEValues &fe_values_volume = fe_values_collection_volume.get_present_fe_values();
+//
+//
+// dealii::TriaIterator> cell_iterator = static_cast> > (current_cell);
+// //if (!(all_parameters->use_weak_form)) fe_values_collection_volume_lagrange.reinit (current_cell, quad_index, mapping_index, fe_index_curr_cell);
+// fe_values_collection_volume_lagrange.reinit (cell_iterator, quad_index, mapping_index, fe_index_curr_cell);
+// const dealii::FEValues &fe_values_lagrange = fe_values_collection_volume_lagrange.get_present_fe_values();
+// assemble_volume_terms_explicit (fe_values_volume, current_dofs_indices, current_cell_rhs, fe_values_lagrange);
+//
+// for (unsigned int iface=0; iface < dealii::GeometryInfo::faces_per_cell; ++iface) {
+//
+// auto current_face = current_cell->face(iface);
+// auto neighbor_cell = current_cell->neighbor(iface);
+//
+// // See tutorial step-30 for breakdown of 4 face cases
+//
+// // Case 1:
+// // Face at boundary
+// if (current_face->at_boundary() && !current_cell->has_periodic_neighbor(iface) ) {
+//
+// fe_values_collection_face_int.reinit (current_cell, iface, quad_index, mapping_index, fe_index_curr_cell);
+//
+// if(current_face->at_boundary() && all_parameters->use_periodic_bc == true && dim == 1) //using periodic BCs (for 1d)
+// {
+// int cell_index = current_cell->index();
+// //int cell_index = current_cell->index();
+// if (cell_index == 0 && iface == 0)
+// {
+// fe_values_collection_face_int.reinit(current_cell, iface, quad_index, mapping_index, fe_index_curr_cell);
+// neighbor_cell = dof_handler.begin_active();
+// for (unsigned int i = 0 ; i < triangulation->n_active_cells() - 1; ++i)
+// {
+// ++neighbor_cell;
+// }
+// neighbor_cell->get_dof_indices(neighbor_dofs_indices);
+// const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
+// const unsigned int quad_index_neigh_cell = fe_index_neigh_cell;
+// const unsigned int mapping_index_neigh_cell = 0;
+//
+// fe_values_collection_face_ext.reinit(neighbor_cell,(iface == 1) ? 0 : 1,quad_index_neigh_cell,mapping_index_neigh_cell,fe_index_neigh_cell);
+//
+// }
+// else if (cell_index == (int) triangulation->n_active_cells() - 1 && iface == 1)
+// {
+// fe_values_collection_face_int.reinit(current_cell, iface, quad_index, mapping_index, fe_index_curr_cell);
+// neighbor_cell = dof_handler.begin_active();
+// neighbor_cell->get_dof_indices(neighbor_dofs_indices);
+// const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
+// const unsigned int quad_index_neigh_cell = fe_index_neigh_cell;
+// const unsigned int mapping_index_neigh_cell = 0;
+// fe_values_collection_face_ext.reinit(neighbor_cell,(iface == 1) ? 0 : 1, quad_index_neigh_cell, mapping_index_neigh_cell, fe_index_neigh_cell); //not sure how changing the face number would work in dim!=1-dimensions.
+// }
+//
+// //std::cout << "cell " << current_cell->index() << "'s " << iface << "th face has neighbour: " << neighbor_cell->index() << std::endl;
+// const int neighbor_face_no = (iface ==1) ? 0:1;
+// const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
+//
+// const dealii::FEFaceValues &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
+// const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
+//
+// const dealii::FESystem &neigh_fe_ref = fe_collection[fe_index_neigh_cell];
+// const unsigned int neigh_cell_degree = neigh_fe_ref.tensor_degree();
+// const unsigned int n_dofs_neigh_cell = neigh_fe_ref.n_dofs_per_cell();
+//
+// dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
+//
+//
+// const unsigned int normal_direction1 = dealii::GeometryInfo::unit_normal_direction[iface];
+// const unsigned int normal_direction2 = dealii::GeometryInfo::unit_normal_direction[neighbor_face_no];
+// const unsigned int deg1sq = (curr_cell_degree == 0) ? 1 : curr_cell_degree * (curr_cell_degree+1);
+// const unsigned int deg2sq = (neigh_cell_degree == 0) ? 1 : neigh_cell_degree * (neigh_cell_degree+1);
+//
+// //const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1) / current_face->number_of_children();
+// const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1);
+// const real vol_div_facearea2 = neighbor_cell->extent_in_direction(normal_direction2);
+//
+// const real penalty1 = deg1sq / vol_div_facearea1;
+// const real penalty2 = deg2sq / vol_div_facearea2;
+//
+// real penalty = 0.5 * ( penalty1 + penalty2 );
+//
+// assemble_face_term_explicit (
+// fe_values_face_int, fe_values_face_ext,
+// penalty,
+// current_dofs_indices, neighbor_dofs_indices,
+// current_cell_rhs, neighbor_cell_rhs);
+//
+// } else {
+// const dealii::FEFaceValues &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
+// const unsigned int deg1sq = (curr_cell_degree == 0) ? 1 : curr_cell_degree * (curr_cell_degree+1);
+// const unsigned int normal_direction = dealii::GeometryInfo::unit_normal_direction[iface];
+// const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction);
+//
+// real penalty = deg1sq / vol_div_facearea1;
+//
+// const unsigned int boundary_id = current_face->boundary_id();
+// // Need to somehow get boundary type from the mesh
+// assemble_boundary_term_explicit (boundary_id, fe_values_face_int, penalty, current_dofs_indices, current_cell_rhs);
+// }
+//
+// //CASE 1.5: periodic boundary conditions
+// //note that periodicity is not adapted for hp adaptivity yet. this needs to be figured out in the future
+// } else if (current_face->at_boundary() && current_cell->has_periodic_neighbor(iface)){
+//
+// neighbor_cell = current_cell->periodic_neighbor(iface);
+// //std::cout << "cell " << current_cell->index() << " at boundary" <index() << std::endl;
+//
+//
+// if (!current_cell->periodic_neighbor_is_coarser(iface) &&
+// (neighbor_cell->index() > current_cell->index() ||
+// (neighbor_cell->index() == current_cell->index() && current_cell->level() < neighbor_cell->level())
+// )
+// )
+// {
+// Assert (current_cell->periodic_neighbor(iface).state() == dealii::IteratorState::valid, dealii::ExcInternalError());
+//
+//
+// // Corresponding face of the neighbor.
+// // e.g. The 4th face of the current cell might correspond to the 3rd face of the neighbor
+// const unsigned int neighbor_face_no = current_cell->periodic_neighbor_of_periodic_neighbor(iface);
+//
+// // Get information about neighbor cell
+// const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
+// const unsigned int quad_index_neigh_cell = fe_index_neigh_cell;
+// const unsigned int mapping_index_neigh_cell = 0;
+// const dealii::FESystem &neigh_fe_ref = fe_collection[fe_index_neigh_cell];
+// const unsigned int neigh_cell_degree = neigh_fe_ref.tensor_degree();
+// const unsigned int n_dofs_neigh_cell = neigh_fe_ref.n_dofs_per_cell();
+//
+// // Local rhs contribution from neighbor
+// dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
+//
+// // Obtain the mapping from local dof indices to global dof indices for neighbor cell
+// neighbor_dofs_indices.resize(n_dofs_neigh_cell);
+// neighbor_cell->get_dof_indices (neighbor_dofs_indices);
+//
+// fe_values_collection_face_int.reinit (current_cell, iface, quad_index, mapping_index, fe_index_curr_cell);
+// const dealii::FEFaceValues &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
+// fe_values_collection_face_ext.reinit (neighbor_cell, neighbor_face_no, quad_index_neigh_cell, mapping_index_neigh_cell, fe_index_neigh_cell);
+// const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
+//
+// const unsigned int normal_direction1 = dealii::GeometryInfo::unit_normal_direction[iface];
+// const unsigned int normal_direction2 = dealii::GeometryInfo::unit_normal_direction[neighbor_face_no];
+// const unsigned int deg1sq = (curr_cell_degree == 0) ? 1 : curr_cell_degree * (curr_cell_degree+1);
+// const unsigned int deg2sq = (neigh_cell_degree == 0) ? 1 : neigh_cell_degree * (neigh_cell_degree+1);
+//
+// //const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1) / current_face->number_of_children();
+// const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1);
+// const real vol_div_facearea2 = neighbor_cell->extent_in_direction(normal_direction2);
+//
+// const real penalty1 = deg1sq / vol_div_facearea1;
+// const real penalty2 = deg2sq / vol_div_facearea2;
+//
+// real penalty = 0.5 * ( penalty1 + penalty2 );
+// //penalty = 1;//99;
+//
+// assemble_face_term_explicit (
+// fe_values_face_int, fe_values_face_ext,
+// penalty,
+// current_dofs_indices, neighbor_dofs_indices,
+// current_cell_rhs, neighbor_cell_rhs);
+//
+// // Add local contribution from neighbor cell to global vector
+// for (unsigned int i=0; ihas_children()) {
+//
+// Assert (current_cell->neighbor(iface).state() == dealii::IteratorState::valid, dealii::ExcInternalError());
+//
+// // Obtain cell neighbour
+// const unsigned int neighbor_face_no = current_cell->neighbor_face_no(iface);
+//
+// for (unsigned int subface_no=0; subface_no < current_face->number_of_children(); ++subface_no) {
+//
+// // Get neighbor on ith subface
+// auto neighbor_cell = current_cell->neighbor_child_on_subface (iface, subface_no);
+// // Since the neighbor cell is finer than the current cell, it should not have more children
+// Assert (!neighbor_cell->has_children(), dealii::ExcInternalError());
+//
+// // Get information about neighbor cell
+// const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
+// const unsigned int quad_index_neigh_cell = fe_index_neigh_cell;
+// const unsigned int mapping_index_neigh_cell = 0;
+// const dealii::FESystem &neigh_fe_ref = fe_collection[fe_index_neigh_cell];
+// const unsigned int neigh_cell_degree = neigh_fe_ref.tensor_degree();
+// const unsigned int n_dofs_neigh_cell = neigh_fe_ref.n_dofs_per_cell();
+//
+// dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
+//
+// // Obtain the mapping from local dof indices to global dof indices for neighbor cell
+// neighbor_dofs_indices.resize(n_dofs_neigh_cell);
+// neighbor_cell->get_dof_indices (neighbor_dofs_indices);
+//
+// fe_values_collection_subface.reinit (current_cell, iface, subface_no, quad_index, mapping_index, fe_index_curr_cell);
+// const dealii::FESubfaceValues &fe_values_face_int = fe_values_collection_subface.get_present_fe_values();
+//
+// fe_values_collection_face_ext.reinit (neighbor_cell, neighbor_face_no, quad_index_neigh_cell, mapping_index_neigh_cell, fe_index_neigh_cell);
+// const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
+//
+// const unsigned int normal_direction1 = dealii::GeometryInfo::unit_normal_direction[iface];
+// const unsigned int normal_direction2 = dealii::GeometryInfo::unit_normal_direction[neighbor_face_no];
+// const unsigned int deg1sq = (curr_cell_degree == 0) ? 1 : curr_cell_degree * (curr_cell_degree+1);
+// const unsigned int deg2sq = (neigh_cell_degree == 0) ? 1 : neigh_cell_degree * (neigh_cell_degree+1);
+//
+// const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1);
+// const real vol_div_facearea2 = neighbor_cell->extent_in_direction(normal_direction2);
+//
+// const real penalty1 = deg1sq / vol_div_facearea1;
+// const real penalty2 = deg2sq / vol_div_facearea2;
+//
+// real penalty = 0.5 * ( penalty1 + penalty2 );
+//
+// assemble_face_term_explicit (
+// fe_values_face_int, fe_values_face_ext,
+// penalty,
+// current_dofs_indices, neighbor_dofs_indices,
+// current_cell_rhs, neighbor_cell_rhs);
+// // Add local contribution from neighbor cell to global vector
+// for (unsigned int i=0; ineighbor_is_coarser(iface))
+// // In the case the neighbor is a ghost cell, we let the processor with the lower rank do the work on that face
+// // We cannot use the cell->index() because the index is relative to the distributed triangulation
+// // Therefore, the cell index of a ghost cell might be different to the physical cell index even if they refer to the same cell
+// && neighbor_cell->is_ghost()
+// && current_cell->subdomain_id() < neighbor_cell->subdomain_id()
+// )
+// ||
+// ( !(current_cell->neighbor_is_coarser(iface))
+// // In the case the neighbor is a local cell, we let the cell with the lower index do the work on that face
+// && neighbor_cell->is_locally_owned()
+// &&
+// ( // Cell with lower index does work
+// current_cell->index() < neighbor_cell->index()
+// ||
+// // If both cells have same index
+// // See https://www.dealii.org/developer/doxygen/deal.II/classTriaAccessorBase.html#a695efcbe84fefef3e4c93ee7bdb446ad
+// // then cell at the lower level does the work
+// (neighbor_cell->index() == current_cell->index() && current_cell->level() < neighbor_cell->level())
+// )
+// )
+// )
+// {
+// Assert (current_cell->neighbor(iface).state() == dealii::IteratorState::valid, dealii::ExcInternalError());
+//
+// auto neighbor_cell = current_cell->neighbor_or_periodic_neighbor(iface);
+// // Corresponding face of the neighbor.
+// // e.g. The 4th face of the current cell might correspond to the 3rd face of the neighbor
+// const unsigned int neighbor_face_no = current_cell->neighbor_of_neighbor(iface);
+//
+// // Get information about neighbor cell
+// const unsigned int fe_index_neigh_cell = neighbor_cell->active_fe_index();
+// const unsigned int quad_index_neigh_cell = fe_index_neigh_cell;
+// const unsigned int mapping_index_neigh_cell = 0;
+// const dealii::FESystem &neigh_fe_ref = fe_collection[fe_index_neigh_cell];
+// const unsigned int neigh_cell_degree = neigh_fe_ref.tensor_degree();
+// const unsigned int n_dofs_neigh_cell = neigh_fe_ref.n_dofs_per_cell();
+//
+// // Local rhs contribution from neighbor
+// dealii::Vector neighbor_cell_rhs (n_dofs_neigh_cell); // Defaults to 0.0 initialization
+//
+// // Obtain the mapping from local dof indices to global dof indices for neighbor cell
+// neighbor_dofs_indices.resize(n_dofs_neigh_cell);
+// neighbor_cell->get_dof_indices (neighbor_dofs_indices);
+//
+// fe_values_collection_face_int.reinit (current_cell, iface, quad_index, mapping_index, fe_index_curr_cell);
+// const dealii::FEFaceValues &fe_values_face_int = fe_values_collection_face_int.get_present_fe_values();
+// fe_values_collection_face_ext.reinit (neighbor_cell, neighbor_face_no, quad_index_neigh_cell, mapping_index_neigh_cell, fe_index_neigh_cell);
+// const dealii::FEFaceValues &fe_values_face_ext = fe_values_collection_face_ext.get_present_fe_values();
+//
+// const unsigned int normal_direction1 = dealii::GeometryInfo::unit_normal_direction[iface];
+// const unsigned int normal_direction2 = dealii::GeometryInfo::unit_normal_direction[neighbor_face_no];
+// const unsigned int deg1sq = (curr_cell_degree == 0) ? 1 : curr_cell_degree * (curr_cell_degree+1);
+// const unsigned int deg2sq = (neigh_cell_degree == 0) ? 1 : neigh_cell_degree * (neigh_cell_degree+1);
+//
+// //const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1) / current_face->number_of_children();
+// const real vol_div_facearea1 = current_cell->extent_in_direction(normal_direction1);
+// const real vol_div_facearea2 = neighbor_cell->extent_in_direction(normal_direction2);
+//
+// const real penalty1 = deg1sq / vol_div_facearea1;
+// const real penalty2 = deg2sq / vol_div_facearea2;
+//
+// real penalty = 0.5 * ( penalty1 + penalty2 );
+// //penalty = 1;//99;
+//
+// assemble_face_term_explicit (
+// fe_values_face_int, fe_values_face_ext,
+// penalty,
+// current_dofs_indices, neighbor_dofs_indices,
+// current_cell_rhs, neighbor_cell_rhs);
+//
+// // Add local contribution from neighbor cell to global vector
+// for (unsigned int i=0; i
+
+#include
+
+// For metric Jacobian testing
+#include
+#include
+#include
+#include
+// *****************
+
#include
+#include
#include
+#include
+#include
+
+#include
+
#include
+#include
+#include
+
+#include
+
#include "high_order_grid.h"
namespace PHiLiP {
@@ -22,11 +44,38 @@ HighOrderGrid::HighOrderGrid(
, mpi_communicator(MPI_COMM_WORLD)
, pcout(std::cout, dealii::Utilities::MPI::this_mpi_process(mpi_communicator)==0)
{
+ Assert(max_degree > 0, dealii::ExcMessage("Grid must be at least order 1."));
+ nth_refinement = 0;
allocate();
const dealii::ComponentMask mask(dim, true);
- dealii::VectorTools::get_position_vector(dof_handler_grid, nodes, mask);
+ get_position_vector(dof_handler_grid, nodes, mask);
nodes.update_ghost_values();
+ update_surface_indices();
+ update_surface_nodes();
mapping_fe_field = std::make_shared< dealii::MappingFEField > (dof_handler_grid,nodes,mask);
+ output_results_vtk(nth_refinement++);
+
+ // Used to check Jacobian validity
+ const unsigned int exact_jacobian_order = (max_degree-1) * dim;
+ const unsigned int min_jacobian_order = 1;
+ const unsigned int used_jacobian_order = std::max(exact_jacobian_order, min_jacobian_order);
+ evaluate_lagrange_to_bernstein_operator(used_jacobian_order);
+
+ auto cell = dof_handler_grid.begin_active();
+ auto endcell = dof_handler_grid.end();
+ std::cout << "Disabled check_valid_cells. Took too much time due to shape_grad()." << std::endl;
+ for (; cell!=endcell; ++cell) {
+ if (!cell->is_locally_owned()) continue;
+ const bool is_invalid_cell = check_valid_cell(cell);
+
+ if ( !is_invalid_cell ) {
+ std::cout << " Poly: " << max_degree
+ << " Grid: " << nth_refinement
+ << " Cell: " << cell->active_cell_index() << " has an invalid Jacobian." << std::endl;
+ // bool fixed_invalid_cell = fix_invalid_cell(cell);
+ // if (fixed_invalid_cell) std::cout << "Fixed it." << std::endl;
+ }
+ }
}
template
@@ -60,6 +109,625 @@ HighOrderGrid::allocate()
//
+template
+void HighOrderGrid
+::get_position_vector(const DoFHandlerType &dh, VectorType &vector, const dealii::ComponentMask &mask)
+{
+ AssertDimension(vector.size(), dh.n_dofs());
+ const dealii::FESystem &fe = dh.get_fe();
+
+ // Construct default fe_mask;
+ const dealii::ComponentMask fe_mask(mask.size() ? mask : dealii::ComponentMask(fe.get_nonzero_components(0).size(), true));
+
+ AssertDimension(fe_mask.size(), fe.get_nonzero_components(0).size());
+
+ std::vector fe_to_real(fe_mask.size(), dealii::numbers::invalid_unsigned_int);
+ unsigned int size = 0;
+ for (unsigned int i = 0; i < fe_mask.size(); ++i) {
+ if (fe_mask[i]) fe_to_real[i] = size++;
+ }
+ Assert(size == dim, dealii::ExcMessage(
+ "The Component Mask you provided is invalid. It has to select exactly dim entries."));
+
+ const dealii::Quadrature quad(fe.get_unit_support_points());
+
+ dealii::MappingQ map_q(fe.degree);
+ dealii::FEValues fe_v(map_q, fe, quad, dealii::update_quadrature_points);
+ std::vector dofs(fe.dofs_per_cell);
+
+ AssertDimension(fe.dofs_per_cell, fe.get_unit_support_points().size());
+ Assert(fe.is_primitive(), dealii::ExcMessage("FE is not Primitive! This won't work."));
+
+ for (const auto &cell : dh.active_cell_iterators()) {
+ if (cell->is_locally_owned()) {
+ fe_v.reinit(cell);
+ cell->get_dof_indices(dofs);
+ const std::vector> &points = fe_v.get_quadrature_points();
+ for (unsigned int q = 0; q < points.size(); ++q) {
+ const unsigned int comp = fe.system_to_component_index(q).first;
+ if (fe_mask[comp]) ::dealii::internal::ElementAccess::set(points[q][fe_to_real[comp]], dofs[q], vector);
+ }
+ }
+ }
+}
+
+
+template
+template
+inline real2 HighOrderGrid
+::determinant(const std::array< dealii::Tensor<1,dim,real2>, dim > jacobian) const
+{
+ if constexpr(dim == 1) return jacobian[0][0];
+ if constexpr(dim == 2)
+ return jacobian[0][0] * jacobian[1][1] - jacobian[1][0] * jacobian[0][1];
+ if constexpr(dim == 3)
+ return (jacobian[0][0] * jacobian[1][1] * jacobian[2][2] -
+ jacobian[0][0] * jacobian[1][2] * jacobian[2][1] -
+ jacobian[1][0] * jacobian[0][1] * jacobian[2][2] +
+ jacobian[1][0] * jacobian[0][2] * jacobian[2][1] +
+ jacobian[2][0] * jacobian[0][1] * jacobian[1][2] -
+ jacobian[2][0] * jacobian[0][2] * jacobian[1][1]);
+}
+
+
+template
+std::vector HighOrderGrid::evaluate_jacobian_at_points(
+ const VectorType &solution,
+ const typename DoFHandlerType::cell_iterator &cell,
+ const std::vector> &points) const
+{
+ const dealii::FESystem &fe = cell->get_fe();
+ const unsigned int n_quad_pts = points.size();
+ const unsigned int n_dofs_cell = fe.n_dofs_per_cell();
+ const unsigned int n_axis = dim;
+
+ std::vector dofs_indices(n_dofs_cell);
+ cell->get_dof_indices (dofs_indices);
+
+ std::array coords;
+ std::array< dealii::Tensor<1,dim,real>, n_axis > coords_grad;
+ std::vector jac_det(n_quad_pts);
+
+ for (unsigned int iquad=0; iquad phys_point;
+ for (int d=0;d