Hello
I want to define the exact solution in polar coordinates attached in the below screenshot:
I try to define it as
lamda = Constant(0.54448373678246)
w = Constant(3 * np.pi / 2)
r = Expression("sqrt(x[0]*x[0] + x[1]*x[1])", degree=3)
theta = Expression("atan2(x[1], x[0])", degree=3)
phi = Expression( "sin((1+lamda)*theta)*cos(lamda*w)*(1/(1+lamda)) - cos((1+lamda)*theta) - sin((1-lamda)*theta)*cos(lamda*w)*(1/(1-lamda)) + cos((1-lamda)*theta)", lamda=lamda, w=w, theta=theta, degree=3)
phi_1 = Expression( "cos((1+lamda)*theta)*cos(lamda*w) + (1+lamda)*sin((1+lamda)*theta)- cos((1-lamda)*theta)*cos(lamda*w) - (1-lamda)*sin((1-lamda)*theta)", lamda=lamda, w=w, theta=theta, degree=3)
phi_3 = Expression("-(1+lamda)*(1+lamda)*cos((1+lamda)*theta)*cos(lamda*w) - (1+lamda)*(1+lamda)*(1+lamda)*sin((1+lamda)*theta) + (1-lamda)*(1-lamda)*cos((1-lamda)*theta)*cos(lamda*w) + (1-lamda)*(1-lamda)*(1-lamda)*sin((1-lamda)*theta)", lamda=lamda, w=w, theta=theta, degree=3)
u_exac = Expression(("pow(r, lamda) * ((1 + lamda) * sin(theta) * phi + cos(theta) * phi_1)", "pow(r, lamda) * (sin(theta) * phi_1 - (1 + lamda) * cos(theta) * phi)"), r=r, theta=theta, phi=phi, phi_1=phi_1, lamda=lamda, domain=mesh, degree=3)
p_exac = Expression("pow(r, lamda-1) * ((1 + lamda)*(1+lamda) * phi_1 + phi_3) / (1 - lamda)", r=r, phi_1=phi_1, phi_3=phi_3, lamda=lamda, domain=mesh, degree=3)
```
Output
===================================================================
hh & e(pl2) & r(pl2) & e(ul2) & r(ul2) & e(uh1) & r(uh1)
===================================================================
0.1177 & nan & 0.000 & nan & 0.000 & nan & 0.000
0.0643 & nan & nan & nan & nan & nan & nan
====================================================================
If I use exact solution other than this then I get correct results. It means there is some mistake in defining this solution. Please help me in this regard.
Thanks