From 046c6fe3f6dc7b6cad13e22add97bd588a3fe074 Mon Sep 17 00:00:00 2001 From: David Wells Date: Fri, 29 Jun 2018 09:17:29 -0400 Subject: [PATCH] Update step-11 to use AffineConstraints. --- examples/step-11/doc/intro.dox | 19 ++++++++++--------- examples/step-11/step-11.cc | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/examples/step-11/doc/intro.dox b/examples/step-11/doc/intro.dox index e80f72b36f..ed8619296f 100644 --- a/examples/step-11/doc/intro.dox +++ b/examples/step-11/doc/intro.dox @@ -79,24 +79,25 @@ index), then the constraint can also be represented by u_{i_0} = \sum_{i\in\partial\Omega_h\backslash i_0} -u_i. @f] This, luckily, is exactly the form of constraints for which the -ConstraintMatrix class was designed. Note that we have used this +AffineConstraints class was designed. Note that we have used this class in several previous examples for the representation of hanging nodes constraints, which also have this form: there, the middle vertex shall have the mean of the values of the adjacent vertices. In general, the -ConstraintMatrix class is designed to handle homogeneous constraints +AffineConstraints class is designed to handle affine constraints of the form @f[ - CU = 0 + CU = b @f] -where $C$ denotes a matrix, and $U$ the vector of nodal values. +where $C$ denotes a matrix, $b$ denotes a vector, and $U$ the vector of nodal +values. In this case, since $C$ represents one homogeneous constraint, $b$ is +the zero vector. In this example, the mean value along the boundary allows just such a representation, with $C$ being a matrix with just one row (i.e. there is only -one constraint). In the implementation, we will create a -ConstraintMatrix object, add one constraint (i.e. add another row to -the matrix) referring to the first boundary node $i_0$, and insert the weights -with which all the other nodes contribute, which in this example happens to be -just $-1$. +one constraint). In the implementation, we will create a AffineConstraints +object, add one constraint (i.e. add another row to the matrix) referring to the +first boundary node $i_0$, and insert the weights with which all the other nodes +contribute, which in this example happens to be just $-1$. Later, we will use this object to eliminate the first boundary node from the linear system of equations, reducing it to one which has a solution without diff --git a/examples/step-11/step-11.cc b/examples/step-11/step-11.cc index 12a7cc4b1b..61550df2d4 100644 --- a/examples/step-11/step-11.cc +++ b/examples/step-11/step-11.cc @@ -89,9 +89,9 @@ namespace Step11 DoFHandler dof_handler; MappingQ mapping; - SparsityPattern sparsity_pattern; - SparseMatrix system_matrix; - ConstraintMatrix mean_value_constraints; + SparsityPattern sparsity_pattern; + SparseMatrix system_matrix; + AffineConstraints mean_value_constraints; Vector solution; Vector system_rhs; -- 2.39.5