0

Can anybody give an elaborate explanation as to why we multiply a test function on both sides of the boundary value problem and then integrate it into the procedure of weak formulation? e.g A BVP $$ -\nabla (A \nabla u) = f \quad \text{on} \quad\Omega$$ $$ u = g \quad \text{on} \quad \partial \Omega$$ For weak formulation we do, $$\int_{\Omega} \phi (-\nabla (A \nabla u) -f) d\Omega = 0$$ Here $\phi$ is the test function

1 Answers1

1

You may want to have a look at this SE post: Finite Element Method Weak Formulation

The key point is the notion of weak solution. The weak solution $u$ (after some suitable assumptions on $A$ and $f$ in order to ensure coercivity and boundedness) of that problem is not $C^2$, but requires less smoothness than the so-called strong solution. So you're relaxing your regularity assumptions, allowing solutions that are not twice differentiable, which are pretty common in applications. This may arise even with simple 1D Poisson problems: consider $-u''(x) = f(x)$ where $f$ is discontinuous. If you do the steps, you'll realise that $u \notin C^2$ on the whole domain. This is pretty informal, and you should try to have a closer look at all of this with a good reference.

Furthermore, the weak formulation of the problem is not the one you wrote, it's slightly different: you're searching a $u \in V$ such that

$$a(u,\phi)=l(\phi)$$

for every $\phi \in V$ where $V$ is an appropriate Sobolev space. Here $a(\cdot,\cdot)$ is a suitable bilinear form, and $l$ a linear functional. Actually, you could be more general and choose a space for test functions which is different from the space where the weak solution $u$ lives. (keyword: Petrov-Galerkin, but this complicates things a little).

In your particular case, you'll have to consider $V=H^1_{\Gamma_D}(\Omega)$ where $\Gamma_D = \partial \Omega$ in this case since you have Dirichlet b.c. on all the boundary.

To solve your problem, you can set $\hat{u} = u-R_g(x)$, where $R_g(x)$ is the so called boundary lifting and it has "value" $g$ on the boundary and $0$ in the interior of the domain. Note that $\hat{u}$ solves the homogeneous problem, because $\hat{u}_{|\partial \Omega} = u_{|\partial \Omega} - R_g(x) = 0$ by definition of $R_g$.

Now, by Green's identity you readily have that you have to search a $\hat{u} \in V$ s.t. $$\int_{\Omega}\nabla \hat{u} \cdot \nabla \phi= \int_\Omega f \phi - \int_{\Omega} \nabla R_g\cdot \nabla \phi $$ for every $\phi \in V$. Once you obtain $\hat{u}$, the solution $u$ will be finally given by $u=\hat{u} + R_g$.

VoB
  • 1,673
  • I understand. But, why do we use a test function $\phi$. What is the importance of that function? – Art of Juking Apr 06 '21 at 14:39
  • 2
    @Rip97 In your particular case, they allow you to define the notion of weak solution. Given that, you will allow a solution to be less smooth and, as I said before, this is crucial as "physical" solutions may not be smooth and so you really need less regularity.

    You may want to have a look here: https://scicomp.stackexchange.com/questions/20327/what-is-the-purpose-of-the-test-function-in-finite-element-analysis?noredirect=1&lq=1.

    or maybe here: https://math.stackexchange.com/questions/304209/what-does-test-function-mean?noredirect=1&lq=1

    – VoB Apr 06 '21 at 15:16