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
DoFHandler<dim> dof_handler;
MappingQ<dim> mapping;
- SparsityPattern sparsity_pattern;
- SparseMatrix<double> system_matrix;
- ConstraintMatrix mean_value_constraints;
+ SparsityPattern sparsity_pattern;
+ SparseMatrix<double> system_matrix;
+ AffineConstraints<double> mean_value_constraints;
Vector<double> solution;
Vector<double> system_rhs;