code (Error control):
def u_ex(mod):
return lambda x: mod.cos(2*mod.pi*x[0])*mod.cos(2*mod.pi*x[1])
https://jsdokken.com/dolfinxtutorial/chapter4/convergence.html)
So from what I gathered it the function is meant to make use of an analytical solution for u. There is also a description in Chapter 20 of dolfinx book where a different forumulation of analytical solution is shewn for Navier stokes where there is also an analytical solution for f, u and rho where the u_ex code shewn it here is said to be for poisson’s.
So then the first question I have is since in both cases a 2D representation is being used to display analytical solutions is there a different analytical formulation for a 3D problem?
Also I looked around for more information on how these analytical solutions get formulated. So far I found a bit of talk about them here:
Detailed Explanation of the Finite Element Method (FEM).
Is there a place to look to as a reference or manual how to develop analytic solutions like this for use with dolfinx for all the different types of problems that may arise?