Enforcing additional constraints in linear equation

33 Views Asked by At

In a finite element context, I come up with a sparse "stiffness matrix" $A$ and a corresponding RHS $b$. The goal is now to solve $$Au = b$$ Where $u$ is a coefficient vector of the solution. Now I have hanging knots in the mesh, that is if I want to ensure continuity of $u$, I have to enforce "glue" constraints of the form $$G_i P_i u = 0$$ Where $G_i$ is a full matrix of the form $G = (M, -I)$ and $P_i$ is some sparse projection matrix (selecting the relevant global basis functions involved in the $i$-th glue)

Now I can think of two ways to enforce these constraints:

  1. Keep $A$ the same size (square) with potentially better solvers by computing $$A_{\text{new}} =A + \sum_{i=1}^{N_\text{glues}} P_i^T G_i$$
  2. Append lines to $A$, making it non-square, for potentially worse solvers and more storage $$A_{\text{new}} = \pmatrix{A\\G_1\\\vdots\\G_{N_\text{glues}}}$$ and appending $0$s to $b$

Wich of these two methods is generally better? Or have I overlooked an even better alternative?
Note that the $G_i$ have full row-rank, if that matters.