From 6d2cdea38a02c04b961b0fe3efaea7f7a02246a4 Mon Sep 17 00:00:00 2001 From: Sebastian Stark Date: Wed, 15 May 2019 21:18:01 +0200 Subject: [PATCH] Fix bug in tutorial step-46 Fix a bug in step-46, which caused the y-displacements (z in 3d) to be unsymmetric --- doc/news/changes/minor/20190515SebastianStark | 3 +++ examples/step-46/step-46.cc | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 doc/news/changes/minor/20190515SebastianStark diff --git a/doc/news/changes/minor/20190515SebastianStark b/doc/news/changes/minor/20190515SebastianStark new file mode 100644 index 0000000000..71a7dd9e9b --- /dev/null +++ b/doc/news/changes/minor/20190515SebastianStark @@ -0,0 +1,3 @@ +Fixed: Fix a bug in tutorial step-46, which caused the y-displacement (z-displacement in 3d) to be slightly unsymmetric. +
+(Sebastian Stark, 2019/05/15) diff --git a/examples/step-46/step-46.cc b/examples/step-46/step-46.cc index 58e5d0bf92..12fa63c0c4 100644 --- a/examples/step-46/step-46.cc +++ b/examples/step-46/step-46.cc @@ -483,7 +483,7 @@ namespace Step46 common_face_quadrature, update_JxW_values | update_normal_vectors | - update_gradients); + update_gradients | update_values); FEFaceValues elasticity_fe_face_values(elasticity_fe, common_face_quadrature, update_values); @@ -491,7 +491,8 @@ namespace Step46 common_face_quadrature, update_JxW_values | update_normal_vectors | - update_gradients); + update_gradients | + update_values); FESubfaceValues elasticity_fe_subface_values(elasticity_fe, common_face_quadrature, update_values); @@ -798,8 +799,11 @@ namespace Step46 stokes_fe_face_values.normal_vector(q); for (unsigned int k = 0; k < stokes_fe_face_values.dofs_per_cell; ++k) - stokes_symgrad_phi_u[k] = - stokes_fe_face_values[velocities].symmetric_gradient(k, q); + { + stokes_symgrad_phi_u[k] = + stokes_fe_face_values[velocities].symmetric_gradient(k, q); + stokes_phi_p[k] = stokes_fe_face_values[pressure].value(k, q); + } for (unsigned int k = 0; k < elasticity_fe_face_values.dofs_per_cell; ++k) elasticity_phi[k] = -- 2.39.5