Hello all,
I am new to Fenics and currently trying to implement Algorithm 5.2 (Primal-dual iteration) from Sören Bartels book ‘Numerical Methods for Nonlinear Partial Differential Equations’.
In that algorithm there appears some kind of discrete divergence
-\text{div}_h^0 \colon \left( P^0(\mathcal{T}_h)^2, (\cdot,\cdot)_{L^2} \right) \rightarrow \left( P^1_0(\mathcal{T}_h), (\cdot, \cdot)_h \right)
as the adjoint of the operator
\nabla \colon \left( P^1_0(\mathcal{T}_h), (\cdot, \cdot)_h \right) \rightarrow \left( P^0(\mathcal{T}_h)^2, (\cdot,\cdot)_{L^2} \right)
with respect to the inner product
(u, v)_h = \sum\limits_{z \in \mathcal{N}_h} \left( \int\limits_{\Omega} \varphi_z \text{d}x \right) u(z) v(z).
Here (\varphi_z)_{z \in \mathcal{N}_h} represent the basis functions of P^1_0(\mathcal{T}_h) on the unit square.
Is there a direct way to implement -\text{div}_h^0 or do I have to solve for given p \in P^0(\mathcal{T}_h)^2 the variational problem
(u,v)_h = (p, \nabla v)_{L^2} \text{ for any } v \in P^1_0(\mathcal{T}_h)
using Fenics?
Thank you very much in advance.