From: Wolfgang Bangerth Date: Thu, 9 May 2019 14:51:58 +0000 (-0600) Subject: Make the polynomial degrees in step-61 selectable. X-Git-Tag: v9.1.0-rc1~102^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3b74e7da8f4e96a165bb85a2711745ebbf2bf3f;p=dealii.git Make the polynomial degrees in step-61 selectable. --- diff --git a/examples/step-61/doc/results.dox b/examples/step-61/doc/results.dox index ed99e7b0ff..d7807542eb 100644 --- a/examples/step-61/doc/results.dox +++ b/examples/step-61/doc/results.dox @@ -1,16 +1,20 @@

Results

-We run the program with a right hand side that will produce the solution -$p = \sin(\pi x) \sin(\pi y)$ and with homogeneous Dirichlet -boundary conditions in the domain $\Omega = (0,1)^2$. In addition, we choose -the coefficient matrix in the differential operator $\mathbf{K}$ as the -identity matrix. We test this setup using $\mbox{WG}(Q_0,Q_0;RT_{[0]})$, -$\mbox{WG}(Q_1,Q_1;RT_{[1]})$ and $\mbox{WG}(Q_2,Q_2;RT_{[2]})$ element -combinations. We will then visualize pressure values in interiors of cells -and on faces. We want to see that the pressure maximum is around 1 and the minimum -is around 0. With mesh refinement, the convergence rates of pressure, -velocity and flux should then be around 1 for $\mbox{WG}(Q_0,Q_0;RT_{[0]})$ , 2 -for $\mbox{WG}(Q_1,Q_1;RT_{[1]})$, and 3 for $\mbox{WG}(Q_2,Q_2;RT_{[2]})$. +We run the program with a right hand side that will produce the +solution $p = \sin(\pi x) \sin(\pi y)$ and with homogeneous Dirichlet +boundary conditions in the domain $\Omega = (0,1)^2$. In addition, we +choose the coefficient matrix in the differential operator +$\mathbf{K}$ as the identity matrix. We test this setup using +$\mbox{WG}(Q_0,Q_0;RT_{[0]})$, $\mbox{WG}(Q_1,Q_1;RT_{[1]})$ and +$\mbox{WG}(Q_2,Q_2;RT_{[2]})$ element combinations, which one can +select by using the appropriate constructor argument for the +`WGDarcyEquation` object in `main()`. We will then visualize pressure +values in interiors of cells and on faces. We want to see that the +pressure maximum is around 1 and the minimum is around 0. With mesh +refinement, the convergence rates of pressure, velocity and flux +should then be around 1 for $\mbox{WG}(Q_0,Q_0;RT_{[0]})$ , 2 for +$\mbox{WG}(Q_1,Q_1;RT_{[1]})$, and 3 for +$\mbox{WG}(Q_2,Q_2;RT_{[2]})$.

Test results on WG(Q0,Q0;RT[0])

diff --git a/examples/step-61/step-61.cc b/examples/step-61/step-61.cc index b6813ae9cf..442d95e4cd 100644 --- a/examples/step-61/step-61.cc +++ b/examples/step-61/step-61.cc @@ -80,7 +80,7 @@ namespace Step61 class WGDarcyEquation { public: - WGDarcyEquation(); + WGDarcyEquation(const unsigned int degree); void run(); private: @@ -244,8 +244,8 @@ namespace Step61 // functions, which will here include the ones used for the interior and // interface pressures, $p^\circ$ and $p^\partial$. template - WGDarcyEquation::WGDarcyEquation() - : fe(FE_DGQ(0), 1, FE_FaceQ(0), 1) + WGDarcyEquation::WGDarcyEquation(const unsigned int degree) + : fe(FE_DGQ(degree), 1, FE_FaceQ(degree), 1) , dof_handler(triangulation) {} @@ -363,7 +363,7 @@ namespace Step61 template void WGDarcyEquation::assemble_system() { - const FE_RaviartThomas fe_rt(0); + const FE_RaviartThomas fe_rt(fe.base_element(0).degree); const QGauss quadrature_formula(fe_rt.degree + 1); const QGauss face_quadrature_formula(fe_rt.degree + 1); @@ -649,7 +649,7 @@ namespace Step61 template void WGDarcyEquation::compute_velocity_errors() { - const FE_RaviartThomas fe_rt(0); + const FE_RaviartThomas fe_rt(fe.base_element(0).degree); const QGauss quadrature_formula(fe_rt.degree + 1); const QGauss face_quadrature_formula(fe_rt.degree + 1); @@ -972,7 +972,7 @@ int main() try { dealii::deallog.depth_console(2); - Step61::WGDarcyEquation<2> wg_darcy; + Step61::WGDarcyEquation<2> wg_darcy(0); wg_darcy.run(); } catch (std::exception &exc)