]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use FiniteElement::shape_function_belongs_to() in step-42. 17961/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 28 Dec 2024 16:51:46 +0000 (09:51 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 28 Dec 2024 16:51:46 +0000 (09:51 -0700)
examples/step-42/step-42.cc

index 61fe72effd43239a9681f3a65f106afa83c0e349..5c49b038b3f2e725c3c15020d69542728c9705e2 100644 (file)
@@ -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;
 

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.