]> https://gitweb.dealii.org/ - dealii.git/commitdiff
update documentation, part XI
authorMatthias Maier <tamiko@43-1.org>
Tue, 4 Feb 2020 21:18:39 +0000 (15:18 -0600)
committerMatthias Maier <tamiko@43-1.org>
Sat, 7 Mar 2020 18:28:55 +0000 (12:28 -0600)
examples/step-69/doc/intro.dox
examples/step-69/doc/results.dox
examples/step-69/step-69.cc
examples/step-69/step-69.prm [new file with mode: 0644]

index bde8b93f9250261033535777c09b9a8d3cc60458..9d52a6bbe3ff44cb726644f339231e5dbea372db 100644 (file)
@@ -12,7 +12,7 @@ high-performance implementation of a second-order accurate scheme that uses
 <i>convex limiting</i> 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}
 
 <h1>Introduction</h1>
 
@@ -362,7 +362,3 @@ application of this kind of schemes, also called <i>edge-based</i> or
 
 @todo Explain what to do for slip, dirichlet and do-nothing boundary
 conditions.
-
-<h3>Implementation of the scheme </h3>
-
-@todo Maybe comment on some key features of the implementation?!
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f7b6b04a2eb3c9ff696d8a8af3710828c7d110a6 100644 (file)
@@ -0,0 +1,148 @@
+<a name="Results"></a>
+<h1>Results</h1>
+
+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<dim>::interpolate_initial_values(t = 0)
+TimeLoop<dim>::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<dim>::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:
+
+<img src="https://www.dealii.org/images/steps/developer/step-69.coarse.gif" alt="" height="300">
+
+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:
+
+<img src="https://www.dealii.org/images/steps/developer/step-69.2nd-order.t400.jpg" alt="" height="300">
+
+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<dim>::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:
+
+<img src="https://www.dealii.org/images/steps/developer/step-69.fine.gif" alt="" height="300">
index 4ddf136de7714089ae0cef75116f69cba547fce0..bab07f39a47480d47b6a2a4e7e22bf864a6812c1 100644 (file)
@@ -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 (file)
index 0000000..e57a9bf
--- /dev/null
@@ -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
+
+

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.