In the tutorial, they get the equation in the strong form and then implement it into FreeFem and show the code. However, I noticed that they do not include the jacobian r*dr in their weak form.
I am simulating a problem similar to that, although without the time dependence. I am confused why the integral does not include that r term.
I think the Jacobian is included in this example (the factor “*x”)
If this can be of any help, below I put another example (for spherical coordinates)
/**************************************************/
/* Coordinate dependant differential operators */
/**************************************************/
/* Spherical coordinates in the (r,theta) plane */
/* */
/* r --> x in [0,infty] */
/* theta --> y in [0,pi] */
/* phi --> not */
/* */
/* Jacobian determinant */
/* The det(J) = r^2*sin(theta) --> x^2*sin(y) */
macro Jac()(x^2*sin(y) ) // /* */
/* The gradient operator in spherical coordinates */
/* */
/* d/dr */
/* grad = 1/r*d/dtheta */
/* 1/(r*sin(theta))*d/dphi */
/* */
macro Grad(u) [dx(u),dy(u)/x] // /* */
macro Lap(u,v) (Grad(u)'*Grad(v)) // /* ') */
/**************************************************/
macro Source()(exp(-x^2)*(6-4*x^2) ) //
Vh u,v;
problem Poisson(u,v) = int2d(Th)( Jac*Lap(u,v) )
-int2d(Th)(Jac*Source*v)
+on(3,u=1)
+on(1,u=0) ;
Poisson;
plot(u,fill=1,value=1,wait=1);
I’ll put also some brief notes I had some time ago, if this can be of any help.
It is for kind of Laplace-Beltrami operator…Here I use the conventions from
field theory/general relativity (raising indices with the metric)
That does help, though I think your last screenshot is over my head a bit.
And I realize sheepishly that it does include the Jacobian now that I went through it again.
I think my confusion stems from the fact that I am trying to run FEM simulations in a sort of weird coordinate system with an equation that I believe is correct. But I am getting strange results that are unphysical when I try to switch from a problem involving cartesian coordinates plus an extra one to one involving polar coordinates plus an extra one, and so I thought maybe the error came from there.
Which I mention here.