I am using FEM to solve a pressure equation for a compressible flow. To obtain the weak form I am stuck at how to integrate by parts the following term:
$\int_{\Omega}P \mathbb{K}:\nabla(\nabla P)d\Omega $
Here, 'P' is a scalar (Pressure) and '$\mathbb{K}$' is a 2nd order tensor of permeability for a material. I have to integrate it by parts to reduce the order of the derivative operator, such that I can define my functional spaces of solution appropriately.
This tensor term $\nabla(\nabla P)$ is creating a problem. I tried to look for a tensor identity to simplify it but I can't find anything helpful. Can anyone suggest something?
I denote the solution by $p$ and the test function by $q$. Moreover, the components of the permeability tensor I denote by $K_{ij}$. Using the index notation, the steady state problem reads $$ \int_\Omega p_{,i} K_{ij} p_{,j}q \,\mathrm{d}x + \int_\Omega p K_{ij} p_{,ij} q \,\mathrm{d}x = 0. $$ Let me perform a direct linearization of this form. For obtaining the Newton's method, we can simply substitute $p = p_0 + \delta p$ where $p_0$ is the initial guess and $\delta p$ is the new unknown (a perturbation towards the true solution). In Newton's method, the higher order terms with $(\delta p)^2$ are approximated with zero.
If I computed correctly, a single step of the Newton's iteration corresponds to: find $\delta p$ such that $$ \int_\Omega (\delta p)_{,i} K_{ij} (p_0)_{,j} q \,\mathrm{d}x + \int_\Omega (p_0)_{,i} K_{ij} (\delta p)_{,j} q \,\mathrm{d}x + \int_\Omega \delta p K_{ij} (p_0)_{,ij} q \,\mathrm{d}x\\ +\int_\Omega p_0 K_{ij} (\delta p)_{,ij} q \,\mathrm{d}x = - \int_\Omega (p_0)_{,i} K_{ij} (p_0)_{,j} q \,\mathrm{d}x-\int_\Omega p_0 K_{ij} (p_0)_{,ij} q \,\mathrm{d}x, $$ for every test function $q$. Note that you might be able to simplify the expressions if $K_{ij}$ has some properties like symmetry.
Now you can use Green's formulae on the annoying terms like the fourth term on the left hand side. E.g. $$ \int_\Omega p_0 K_{ij} (\delta p)_{,ij} q \,\mathrm{d}x = - \int_{\Omega} (p_0 q)_{,j} K_{ij} (\delta p)_{,i} \,\mathrm{d}x \quad \text{(+ possible boundary terms.)} $$
Thus, you start with an initial guess $p_0$ and compute the perturbation $\delta p$. Then you get a new initial guess from $p_0 + \delta p$. Do this repeatedly as long as $\delta p$ is small (in some appropriate norm).