I've been working on the finite element method and got stuck at the following point.
To solve the displacements in a mechanical rigid body we need to solve this system of equations:
$$Ku=f$$
The problem is that I do not know every value of $f$. On the other hand, I know a few values of $u$. In fact I know exactly the values of $u$ that are unknown for $f$. Maybe this small example helps:
I thought that there must be a way to transform this system of linear equations into a system where the rhs is fully known. Is there a way to do this?
I am very happy if someone could help me here.

I agree, being originated from something as concrete as mechanical rigid body, it feels like there must be a way to solve this completely.
At first glance, it is not clear what to do. When in doubt, let's apply the definition to expand the matrix multiplication and see what we get: $$\begin{align} \pmatrix{f_{x1} \\ f_{y1} \\ 0 \\ f_{y2} \\ f_{x} \\ f_{y}} &= 0 \pmatrix{k_{11} \\ k_{21} \\ k_{31} \\ k_{41} \\ k_{51} \\ k_{61}} + 0 \pmatrix{k_{12} \\ k_{22} \\ k_{32} \\ k_{42} \\ k_{52} \\ k_{62}} + u_{x2} \pmatrix{k_{13} \\ k_{23} \\ k_{33} \\ k_{43} \\ k_{53} \\ k_{63}} + 0 \pmatrix{k_{14} \\ k_{24} \\ k_{34} \\ k_{44} \\ k_{54} \\ k_{64}} + u_{x3} \pmatrix{k_{15} \\ k_{25} \\ k_{35} \\ k_{45} \\ k_{55} \\ k_{65}} + u_{y3} \pmatrix{k_{16} \\ k_{26} \\ k_{36} \\ k_{46} \\ k_{56} \\ k_{66}} \\ &= u_{x2} \pmatrix{k_{13} \\ k_{23} \\ k_{33} \\ k_{43} \\ k_{53} \\ k_{63}} + u_{x3} \pmatrix{k_{15} \\ k_{25} \\ k_{35} \\ k_{45} \\ k_{55} \\ k_{65}} + u_{y3} \pmatrix{k_{16} \\ k_{26} \\ k_{36} \\ k_{46} \\ k_{56} \\ k_{66}} \end{align}$$ Next, remove the rows with $f_{x1}, f_{y1}$ and $f_{y2}$ since they are not known: $$\pmatrix{0 \\ f_{x} \\ f_{y}} = u_{x2} \pmatrix{k_{33} \\ k_{53} \\ k_{63}} + u_{x3} \pmatrix{k_{35} \\ k_{55} \\ k_{65}} + u_{y3} \pmatrix{k_{36} \\ k_{56} \\ k_{66}}$$ Re-write it back into a linear system: $$\pmatrix{0 \\ f_{x} \\ f_{y}} =\pmatrix{k_{33} & k_{35} & k_{36} \\ k_{53} & k_{55} & k_{56} \\ k_{63} & k_{65} & k_{66}} \pmatrix{u_{x2} \\ u_{x3} \\ u_{y3}}$$ Therefore, we now know $u_{x2}, u_{x3}$ and $u_{y3}$ by solving the above linear system.
Finally, from the first equation: $$\pmatrix{f_{x1} \\ f_{y1} \\ f_{y2}} = u_{x2} \pmatrix{k_{13} \\ k_{23} \\ k_{43}} + u_{x3} \pmatrix{k_{15} \\ k_{25} \\ k_{45}} + u_{y3} \pmatrix{k_{16} \\ k_{26} \\ k_{46}}$$ Re-write it back into matrix form: $$\pmatrix{f_{x1} \\ f_{y1} \\ f_{y2}} = \pmatrix{k_{13} & k_{15} & k_{16} \\ k_{23} & k_{25} & k_{26} \\ k_{43} & k_{45} & k_{46}} \pmatrix{u_{x2} \\ u_{x3} \\ u_{y3}}$$ We now know $f_{x1}, f_{y1}$ and $f_{y2}$ as well since $u_{x2}, u_{x3}$ and $u_{y3}$ are already known. Hence we have found all unknowns in the original linear system.