# inclined/general Dirichlet boundary conditions For simpilcity, consider a single quad linear elasticity finite element in 2D. The Dirichlet boundary conditions on node 1 and node 2 are easy to implement and can be handled in the standard way. However, the Dirichlet boundary condition on node 3 is more general and is of the form:

$$au_{3x} + bu_{3y} = 0$$

where $$a$$ and $$b$$ are real numbers and $$u_{3x}$$ and $$u_{3y}$$ are the components of the displacement of the node 3, denoted by ($$\bf{u_3}$$), in the $$x$$ and $$y$$ direction. We can handle this boundary condition by Lagrange multipliers and this will result in a matrix system as below, which I think will have increased bandwidth as compared to the standard way of handling Dirichlet boundary conditions. Also, the presence of the $$0$$ matrix might cause problems for the linear system solver (please correct me if I'm wrong).

$$\begin{pmatrix} K & B \\ B & 0 \end{pmatrix} \begin{pmatrix} d \\ \lambda \end{pmatrix} = \begin{pmatrix} f\\ h \end{pmatrix}$$

This treatment is from here: Page 73.

What is the correct/best way of handling inclined/general Dirichlet boundary conditions? Is it Nitsche's method?

Can we handle inclined/general Dirichlet boundary conditions by incorporating them into our finite dimensional expansions for the displacement field?

## 2 Answers

The traditional way to handle this type of boundary condition is to create a transformed coordinate system at node 3 so that one of its axes is along the direction you want to constrain. You use the coordinate transformation matrix at this node to transform your stiffness matrix and then constrain the system in the usual way, e.g. by removing the equation corresponding to the constrained degree of freedom.

As you point out, using a Lagrange multiplier is a perfectly acceptable alternate way to prescribe this constraint. The only unavoidable downside is that you increase the number of equations (by one in this case). You do increase the bandwidth of the equations but modern sparse solvers are not concerned with the bandwidth of the matrix. The zero on the diagonal does not mean the matrix is singular. It is negative-definite, however, so the sparse solver you choose must handle this case (i.e. a classical Cholesky factorization will fail).

Bill Greene presents the point of view of how things have been done traditionally. The "modern" way is to add "constraints" to your linear system which, in the current case, would be $$u_{3x} = -u_{3y}.$$ These constraints can be entered straight into the linear system without the detour of the augmented linear system you show -- although the modified linear system can also just be thought of as having done one Gauss elimination step to get rid of the extra row and column.

To provide just one example, in the deal.II finite element library, these sorts of constraints are implemented by the AffineConstraints class. (Disclaimer: I'm one of the principal developers of deal.II.)

• @Wolfgang_Bangerth The stiffness matrix is typically square. If we add an equation to it, wouldn't it become non-square? – Nachiket Dec 7 '20 at 5:06
• @Nachiket You add a constraint to a square linear system, which isn't just one additional row. If you enforce the constraint via a Lagrange multiplier, then that would add a row and a column to the matrix. But you can just eliminate the constrained degree of freedom from the linear system, which would reduce its size by one row and one column. Or you can just zero out one row and one column and modify some others, in which case the size of the matrix remains the same :-) – Wolfgang Bangerth Dec 7 '20 at 17:48