pdelab / modular-pnp

This repository contains a modularized implementation of the PNP solver in which functionalities are organized into Newton solver techniques, conversion methods between FEniCS and FASP, as well as geometric and parameter functionalities. An additional library specific to strictly PNP functionalities is also within.
https://thepnpsolver.github.io/
4 stars 0 forks source link

Computing the nonlinear residual #35

Open maximilianmetti opened 8 years ago

maximilianmetti commented 8 years ago

This is a nontrivial part of the code, but we can reference this paper by one of the professors at UCSD who's been really successful at solving a simplified version of PNP.

maximilianmetti commented 8 years ago

Our current implementation projects the residual into the finite element space, but should ideally compute the norm of the residual directly (rather than the norm of the projected residual). We want to make the norm of the residual agnostic to the mesh.... if possible

maximilianmetti commented 8 years ago

@arthbous want to leave a little note describing your work towards this end? We should also search for a paper (or look in a book about finite element solutions nonlinear problems) to get appropriate stopping conditions for this problems.

maximilianmetti commented 7 years ago

@arthbous we should compute the nonlinear residual the same way we compute the local entropy:

This is equivalent to defining the (mesh-dependent and diagonal) mass-lumping matrix for L2-projection, M, and multiplying the residual vector r

eqn_residual = transpose(inv(M) * r) * (inv(M) * r) / (transpose(inv(M) * 1) * (inv(M) * 1))

The total residual is sum(eqn_residual).

Algorithmically, we just need to compute

I think this will give us the best approximation to the nonlinear residual. I feel like we tried to do this before but didn't quite get it right... Did you try to do this at some point? What are your thoughts on this approach?

The pain in the ass about this is computing r, which is dependent on the equation at hand (i.e. it's not the same expression for the Poisson and Nernst-Planck equations).