From 31e49200f0c023c01f2e63d0923ecefabe407fcd Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 4 Feb 2020 15:18:39 -0600 Subject: [PATCH] update documentation, part XI --- examples/step-69/doc/intro.dox | 6 +- examples/step-69/doc/results.dox | 148 +++++++++++++++++++++++++++++++ examples/step-69/step-69.cc | 6 ++ examples/step-69/step-69.prm | 64 +++++++++++++ 4 files changed, 219 insertions(+), 5 deletions(-) create mode 100644 examples/step-69/step-69.prm diff --git a/examples/step-69/doc/intro.dox b/examples/step-69/doc/intro.dox index bde8b93f92..9d52a6bbe3 100644 --- a/examples/step-69/doc/intro.dox +++ b/examples/step-69/doc/intro.dox @@ -12,7 +12,7 @@ high-performance implementation of a second-order accurate scheme that uses convex limiting techniques, and strong stability-preserving (SSP) time integration, see @cite GuermondEtAl2018. -@dealiiTutorialDOI{10.5281/zenodo.3634929,https://zenodo.org/badge/DOI/10.5281/zenodo.3634929.svg} +@dealiiTutorialDOI{10.5281/zenodo.3643899,https://zenodo.org/badge/DOI/10.5281/zenodo.3643899.svg}

Introduction

@@ -362,7 +362,3 @@ application of this kind of schemes, also called edge-based or @todo Explain what to do for slip, dirichlet and do-nothing boundary conditions. - -

Implementation of the scheme

- -@todo Maybe comment on some key features of the implementation?! diff --git a/examples/step-69/doc/results.dox b/examples/step-69/doc/results.dox index e69de29bb2..f7b6b04a2e 100644 --- a/examples/step-69/doc/results.dox +++ b/examples/step-69/doc/results.dox @@ -0,0 +1,148 @@ + +

Results

+ +Running the program with default parameters in release mode takes about 1 +minute on a 4 core machine (with hyperthreading): +@verbatim +$ mpirun -np 4 ./step-69 | tee output +Reading parameters and allocating objects... done + + #################################################### + ######### ######### + ######### create triangulation ######### + ######### ######### + #################################################### + +Number of active cells: 36864 + + #################################################### + ######### ######### + ######### compute offline data ######### + ######### ######### + #################################################### + +Number of degrees of freedom: 37376 + + #################################################### + ######### ######### + ######### set up time step ######### + ######### ######### + #################################################### + + #################################################### + ######### ######### + ######### interpolate initial values ######### + ######### ######### + ######### ######### + #################################################### + +TimeLoop::interpolate_initial_values(t = 0) +TimeLoop::output(t = 0, checkpoint = 0) + + #################################################### + ######### ######### + ######### enter main loop ######### + ######### ######### + ######### ######### + #################################################### + + #################################################### + ######### ######### + ######### Cycle 000001 (0.0%) ######### + ######### at time t = 0.00000000 ######### + ######### ######### + #################################################### + +[...] + + #################################################### + ######### ######### + ######### Cycle 007553 (100.0%) ######### + ######### at time t = 3.99984036 ######### + ######### ######### + #################################################### + +TimeLoop::output(t = 4.00038, checkpoint = 1) + ++------------------------------------------------------------------------+------------+------------+ +| Total CPU time elapsed since start | 357s | | +| | | | +| Section | no. calls | CPU time | % of total | ++------------------------------------------------------------+-----------+------------+------------+ +| discretization - setup | 1 | 0.113s | 0% | +| offline_data - assemble lumped mass matrix, and c_ij | 1 | 0.167s | 0% | +| offline_data - compute |c_ij|, and n_ij | 1 | 0.00255s | 0% | +| offline_data - create sparsity pattern and set up matrices | 1 | 0.0224s | 0% | +| offline_data - distribute dofs | 1 | 0.0617s | 0% | +| offline_data - fix slip boundary c_ij | 1 | 0.0329s | 0% | +| schlieren_postprocessor - compute schlieren plot | 201 | 0.811s | 0.23% | +| schlieren_postprocessor - prepare scratch space | 1 | 7.6e-05s | 0% | +| time_loop - setup scratch space | 1 | 0.127s | 0% | +| time_loop - stalled output | 200 | 0.000685s | 0% | +| time_step - 1 compute d_ij | 7553 | 240s | 67% | +| time_step - 2 compute d_ii, and tau_max | 7553 | 11.5s | 3.2% | +| time_step - 3 perform update | 7553 | 101s | 28% | +| time_step - 4 fix boundary states | 7553 | 0.724s | 0.2% | +| time_step - prepare scratch space | 1 | 0.00245s | 0% | ++------------------------------------------------------------+-----------+------------+------------+ +@endverbatim + +One thing that becomes evident is the fact that the program spends two +thirds of the execution time computing the graph viscosity d_ij and about a +third of the execution time in performing the update, where computing the +flux $f(U)$ is the expensive operation. The preset default resolution is +about 37k gridpoints, which amounts to about 148k spatial degrees of +freedom in 2D. An animated schlieren plot of the solution looks as follows: + + + +It is evident that 37k gridpoints for the first-order method is nowhere +near the resolution needed to resolve any flow features. For comparison, +here is a "reference" computation with a second-order method and about 9.5M +gridpoints: + + + +So, we give the first-order method a second chance and run it with about +2.4M gridpoints on a small compute server: + +@verbatim +$ mpirun -np 16 ./step-69 | tee output + +[...] + + #################################################### + ######### ######### + ######### Cycle 070216 (100.0%) ######### + ######### at time t = 3.99999231 ######### + ######### ######### + #################################################### + +TimeLoop::output(t = 4.00006, checkpoint = 1) + ++------------------------------------------------------------------------+------------+------------+ +| Total CPU time elapsed since start | 3.34e+05s | | +| | | | +| Section | no. calls | CPU time | % of total | ++------------------------------------------------------------+-----------+------------+------------+ +| discretization - setup | 1 | 1.96s | 0% | +| offline_data - assemble lumped mass matrix, and c_ij | 1 | 10.6s | 0% | +| offline_data - compute |c_ij|, and n_ij | 1 | 0.208s | 0% | +| offline_data - create sparsity pattern and set up matrices | 1 | 0.38s | 0% | +| offline_data - distribute dofs | 1 | 1.36s | 0% | +| offline_data - fix slip boundary c_ij | 1 | 2.52s | 0% | +| schlieren_postprocessor - compute schlieren plot | 201 | 24.3s | 0% | +| schlieren_postprocessor - prepare scratch space | 1 | 0.008s | 0% | +| time_loop - setup scratch space | 1 | 1.48s | 0% | +| time_loop - stalled output | 200 | 0.004s | 0% | +| time_step - 1 compute d_ij | 70216 | 5.79e+04s | 17% | +| time_step - 2 compute d_ii, and tau_max | 70216 | 5.78e+03s | 1.7% | +| time_step - 3 perform update | 70216 | 2.51e+04s | 7.5% | +| time_step - 4 fix boundary states | 70216 | 56.8s | 0% | +| time_step - prepare scratch space | 1 | 0.028s | 0% | ++------------------------------------------------------------+-----------+------------+------------+ +@endverbatim + +And with the following result: + + diff --git a/examples/step-69/step-69.cc b/examples/step-69/step-69.cc index 4ddf136de7..bab07f39a4 100644 --- a/examples/step-69/step-69.cc +++ b/examples/step-69/step-69.cc @@ -2605,12 +2605,18 @@ namespace Step69 print_head(pcout, "create triangulation"); discretization.setup(); + pcout << "Number of active cells: " + << discretization.triangulation.n_global_active_cells() << std::endl; + // assemble all matrices print_head(pcout, "compute offline data"); offline_data.setup(); offline_data.assemble(); + pcout << "Number of degrees of freedom: " + << offline_data.dof_handler.n_dofs() << std::endl; + // and set up scratch space: print_head(pcout, "set up time step"); diff --git a/examples/step-69/step-69.prm b/examples/step-69/step-69.prm new file mode 100644 index 0000000000..e57a9bf36b --- /dev/null +++ b/examples/step-69/step-69.prm @@ -0,0 +1,64 @@ +# Listing of Parameters +# --------------------- +subsection A - TimeLoop + # Base name for all output files + set basename = test + + # Final time + set final time = 4 + + # time interval for output + set output granularity = 0.02 + + # Resume an interrupted computation. + set resume = false +end + + +subsection B - Discretization + # Immersed disc: height of computational domain + set immersed disc - height = 2 + + # Immersed disc: length of computational domain + set immersed disc - length = 4 + + # Immersed disc: diameter of immersed disc + set immersed disc - object diameter = 0.5 + + # Immersed disc: x position of immersed disc center point + set immersed disc - object position = 0.6 + + # Initial refinement of the geometry + set initial refinement = 5 +end + + +subsection C - OfflineData +end + + +subsection D - InitialValues + # Initial 1d state (rho, u, p) of the uniform flow field + set initial 1d state = 1.4, 3, 1 + + # Initial direction of the uniform flow field + set initial direction = 1, 0 +end + + +subsection E - TimeStep + # relative CFL constant used for update + set cfl update = 0.8 +end + + +subsection F - SchlierenPostprocessor + # Beta factor used in Schlieren-type postprocessor + set schlieren beta = 10 + + # Use the corresponding component of the state vector for the schlieren + # plot + set schlieren index = 0 +end + + -- 2.39.5