]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix constraint handling in step-26 1994/head
authorTimo Heister <timo.heister@gmail.com>
Fri, 18 Dec 2015 05:41:30 +0000 (00:41 -0500)
committerTimo Heister <timo.heister@gmail.com>
Sun, 20 Dec 2015 23:25:58 +0000 (18:25 -0500)
A recent change in create_*_matrix now actually makes use of the
ConstraintMatrix argument breaking this example. We actually don't want
to apply constraints here, because they will be changing over time.

examples/step-26/step-26.cc

index daaa037309de5f2180dc24156dc4a94be3232e9d..747248b48114d4d9f950b206d32275bd22e139da 100644 (file)
@@ -217,19 +217,11 @@ namespace Step26
   // to their correct sizes. We also compute the mass and Laplace
   // matrix here by simply calling two functions in the library.
   //
-  // Note that we compute these matrices taking into account already the
-  // constraints due to hanging nodes. These are all homogenous, i.e.,
-  // they only consist of constraints of the form $U_i = \alpha_{ij} U_j
-  // + \alpha_{ik} U_k$ (whereas inhomogenous constraints would also
-  // have a term not proportional to $U$, i.e., $U_i = \alpha_{ij} U_j
-  // + \alpha_{ik} U_k + c_i$). For this kind of constraint, we can
-  // eliminate hanging nodes independently in the matrix and the
-  // right hand side vectors, but this is not the case for inhomogenous
-  // constraints for which we can eliminate constrained degrees of freedom
-  // only by looking at both the system matrix and corresponding right
-  // right hand side at the same time. This may become a problem when
-  // dealing with non-zero Dirichlet boundary conditions, though we
-  // do not do this here in the current program.
+  // Note that we do not take the hanging node constraints into account when
+  // assembling the matrices (both functions have a ConstraintMatrix argument
+  // that defaults to an empty object). This is because we are going to
+  // condense the constraints in run() after combining the matrices for the
+  // current time-step.
   template<int dim>
   void HeatEquation<dim>::setup_system()
   {
@@ -262,14 +254,10 @@ namespace Step26
 
     MatrixCreator::create_mass_matrix(dof_handler,
                                       QGauss<dim>(fe.degree+1),
-                                      mass_matrix,
-                                      (const Function<dim> *)0,
-                                      constraints);
+                                      mass_matrix);
     MatrixCreator::create_laplace_matrix(dof_handler,
                                          QGauss<dim>(fe.degree+1),
-                                         laplace_matrix,
-                                         (const Function<dim> *)0,
-                                         constraints);
+                                         laplace_matrix);
 
     solution.reinit(dof_handler.n_dofs());
     old_solution.reinit(dof_handler.n_dofs());

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.