From: Wolfgang Bangerth Date: Sat, 28 Dec 2024 16:51:46 +0000 (-0700) Subject: Use FiniteElement::shape_function_belongs_to() in step-42. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4de41957fecff2ec14be52471603834bd5d3cb5d;p=dealii.git Use FiniteElement::shape_function_belongs_to() in step-42. --- diff --git a/examples/step-42/step-42.cc b/examples/step-42/step-42.cc index 61fe72effd..5c49b038b3 100644 --- a/examples/step-42/step-42.cc +++ b/examples/step-42/step-42.cc @@ -1237,7 +1237,7 @@ namespace Step42 { // At each quadrature point (i.e., at each support point of a // degree of freedom located on the contact boundary), we then - // ask whether it is part of the z-displacement degrees of + // ask whether it is part of the $z$-displacement degrees of // freedom and if we haven't encountered this degree of // freedom yet (which can happen for those on the edges // between faces), we need to evaluate the gap between the @@ -1248,12 +1248,12 @@ namespace Step42 // to the correct value, and add the index to the IndexSet // object that stores which degree of freedom is part of the // contact: - const unsigned int component = - fe.face_system_to_component_index(q_point).first; + const FEValuesExtractors::Scalar z_displacement(2); const unsigned int index_z = dof_indices[q_point]; - if ((component == 2) && (dof_touched[index_z] == false)) + if (fe.shape_function_belongs_to(q_point, z_displacement) && + (dof_touched[index_z] == false)) { dof_touched[index_z] = true;