I have the same question of this one
$\bullet $ In the answer I've seen that a "Lifting" function is used, is it to have a formulation where the test functions are in the same space of the solution?
If I consider
$$ \left\{ \begin{gathered} -u'' = f{\text{ on }} \Omega =\left] {0,1} \right[ \hfill \\ u(0) = \alpha \hfill \\ u(1) = \beta \hfill \\ \end{gathered} \right.$$ where $\alpha$ and $\beta$ are different from $0$.
Since I have inhomogeneous b.c., the weak formulation I would be tempted to write is "Find $u \in H^1$ s.t $$ \int_0^1 u'\phi' = \int_0^1 f \phi $$
for every $\phi \in H_0^1$".
Question:
$\bullet $ Now the issue is that the basis are different, right? Because a finite dimensional basis of $H^1$ will have also the half hat functions $\varphi_0$ and $\varphi_M$ at the boundary, while the one of $H_0^1$ doesn't. So I think that the lifting function $R(x)$ described in the link is the right thing to do.
Last question, really important:
$\bullet $ To solve it numerically from $0=x_0<x_1 < \ldots x_M=1$, I build the usual matrix $(M+1) \times (M+1)$ where $a_{ij}=\int_0^1 \varphi _i \varphi_j dx$ and then change the last and first row of the matrix (the first row will be $[1,0,\ldots0]$ and the last $[0,\ldots, 1]$ and the last and first component of the "load vector" $b$ in order to impose the Dirichlet boundary conditions.
In this way I am implicitly using the same basis for $u$ and for the test functions $\phi$, made by all the hat functions. So including also the both "half" hat-functions $\varphi_0, \ldots, \varphi_M$. So, strictly speaking, it's a "numerical" trick to impose the conditions, right?
But I'm still confused: in the your answer that I just linked you consider for the Dirichlet (inhomogeneous) boundary condition at $x=0$ the test function $f$ to be $f(0)=0$ , while for the Neumann b.c. you just plug the "derivative information" into the weak formulation (and that's actually clear to me). But that is different from using a "lifting function" like the OP in your link tried to do
– VoB Dec 06 '19 at 19:42This argument, instead, does not apply with Neumann boundary conditions, since in those cases the derivative goes inside the weak fomulation, right?
– VoB Dec 06 '19 at 19:53