# How to tell mathematica polar coordinates belong to mesh?

Context

I want to solve a PDE via FEM on a Disk.

If I use a Square I can write

reg = Rectangle[];
mesh =  ToElementMesh[reg, MaxCellMeasure -> 0.001];


Then I can for instance

Plot3D[x y, {x, y} ∈ reg]


But, if I want to operate on a disc,

reg = Disk[];
mesh = ToElementMesh[reg, MaxCellMeasure -> 0.001];


I could for instance write

Plot3D[ r Exp[-r^2] Cos[2θ] /. θ -> ArcTan[x, y] /.
r -> Sqrt[x^2 + y^2] // Evaluate, {x, y} ∈ reg,
PlotRange -> All]


But Ideally I would like to stick to Polar coordinates.

Question

How can I ask mathematica to sample polar points on my disc?

I.e. I would like to write

Plot3D[ r Exp[-r^2] Cos[2θ], {r, θ} ∈ reg,
PlotRange -> All]


Of course for this simple graphics the workaround is trivial. But what I want eventually is to solve

sol = NDSolveValue[{-Laplacian[u[r, θ], {r, θ},
"Polar"] == 0 , DirichletCondition[u[r, θ] == 0, True]},
u, {r, θ} ∈ mesh ]


I hope my question makes sense?

But what I want eventually is to solve

sol = NDSolveValue[{-Laplacian[u[r, θ], {r, θ},
"Polar"] == 0 , DirichletCondition[u[r, θ] == 0, True]},
u, {r, θ} ∈ mesh ]


You must made typo in above, as it is clear solution is zero without solving it. May be you meant to add a non-zero boundary condition or make the RHS of the PDF non-zero?

For example, if you want DirichletCondition[u[r, θ] == θ, you could write the same command as

<< NDSolveFEM
reg = Disk[];
mesh = ToElementMesh[reg, MaxCellMeasure -> 0.0001];
mesh["Wireframe"];
solFEM = NDSolveValue[{-Laplacian[u[x, y], {x, y}] == 0,
DirichletCondition[u[x, y] == ArcTan[x, y], True]},
u[x, y], Element[{x, y}, mesh]]
Plot3D[solFEM, Element[{x, y}, mesh]]


If you want to use polar coordinates explicitly, then you can use DSolve for this. But of course DSolve will not be able to some many problems that NDSolve can.

ClearAll[u, θ, r, a];
pde = -Laplacian[u[r, θ], {r,θ}, "Polar"] == 0;
bc = u[1,θ] ==θ;
sol = DSolve[{pde, bc}, u[r, θ], {r,θ}];
sol = sol /. {K[1] -> n, Infinity -> 100}


sol = Activate[u[r,θ] /. First@sol];
RevolutionPlot3D[sol, {r, 0, 1}, {θ, 0, 2 Pi}]


I do not think that Mathematica's Finite elements numerical solver supports non-cartesian coordinates as the default.

May be someone else knows more. But since it is a numerical solver, Why is it important to tell it to use different coordinates system?

Using different coordinate system is important in analytical solutions, since it can simplify the mathematics quit a bit when choosing the right coordinates based on geometry.

Plot3D[ r Exp[-r^2] Cos[2θ] /. θ -> ArcTan[x, y] /.

ParametricPlot3D[{r Cos[θ], r Sin[θ], r Exp[-r^2] Cos[2 θ]}, {r, 0, 1}, {θ, 0, 2 Pi}]