This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Is it possible to solve diff. eq. using FeniCS is spherical coordinate system

+2 votes

I mean that i have the equation in spherical coordinate system, and I want to solve them in spherical coordinate (not using boxes) also I want to show my solved results in spherical coordinate. Is it possible in FeniCS package?
Thank you very much! =-)

asked Sep 12, 2013 by jedcraft FEniCS Novice (170 points)
edited Sep 12, 2013 by Garth N. Wells

1 Answer

+3 votes
 
Best answer

Yes and No!

Yes, because Fenics, or any other FEM package, does not care what coordinate system you are in. It just gets a mesh and differential operators.

No, because one has to do the weak formulation, no matter in which coordinates, by its own. And, as far as I know, there is no feature in Fenics, that can transfer a formulation in Cartesian coordinates to a different coordinate system.

As an example: Assume you want to solve for a heat distribution in a 3D sphere. Then one chooses(!) spherical coordinates, simply because in this system, the sphere is a cube that can be easily discretized, e.g. by Fenic's function BoxMesh. However, the differential operators of the heat equation are typically formulated for Cartesian coordinates and one has to transform them to the new coordinates before deriving the the weak formulation.

answered Sep 12, 2013 by Jan FEniCS User (8,290 points)
selected Sep 25, 2013 by Jan Blechta

Thank you! for your answer!. =)
I'm beginner in FeniCS, therefore i have "noob" question like this.
I have a some model, and this model have already created in Eulerian coordinate system (e.g. in spherical coordinates - height, latitude, longitude) and it will be very good for me to "rewrite" this model in FeniCS in the same coordinate system. I think that Sphere mesh will be well for this problem, Will try. =) Thank you one more again!

I have the same type of issue. I became confused about solving the equation. There are two possibilities:

  1. Define V (function space), test function (v) and trial function (u) on a mesh in Eulerian coordinate system and then convert the points in spherical coordinates.
  2. First write the initial mesh in the spherical coordinate system and then define V, u and v on the converted mesh.

Which one that we need to follow?

...