Subject: [Fenics] PDEs on quirky geometries

From: Harish Narayanan <[email-masked]>
Date: Fri, 18 Dec 2009 00:02:52 +0000

Dear fellow PDE solvers,

The sort of question I am about the phrase might seem strange to some,
but perhaps it will seem natural to others.

Last evening, I was curious about meshing quirky geometries like the
Möbius strip in DOLFIN. This morning, I was curious about solving a PDE
on such a domain, and so I came up with the attached python script.

The script purportedly sets up a Poisson equation (with homogeneous
boundary conditions and a constant source) on a Möbius strip (with four
twists) and "solves it." I see a pretty looking plot with some
psychedelic colours, but can someone who knows more about this stuff be
kind enough to clarify what I've ended up doing?

Harish

---

From: Marie Rognes <[email-masked]>
Date: Fri, 18 Dec 2009 14:53:31 +0100

> kind enough to clarify what I've ended up doing?

I haven't got the foggiest, but I'd like to know more as well!

So is this a mesh of triangles with 3D coordinates? (I didn't even know 
that we could do that ;) )

--
Marie

---

From: Anders Logg <[email-masked]>
Date: Fri, 18 Dec 2009 15:08:59 +0100

On Fri, Dec 18, 2009 at 02:53:31PM +0100, Marie Rognes wrote:
> So is this a mesh of triangles with 3D coordinates? (I didn't even
> know that we could do that ;) )

Anything is possible with FEniCS.

But I'm also quite amazed Harish managed to do this. I would assume it
would break in any number of places all over (FFC, DOLFIN, Viper) but
apparently not. I need to think more on why and how this works and
what it actually does.

--
Anders

---

From: Marie Rognes <[email-masked]>
Date: Fri, 18 Dec 2009 15:19:04 +0100

Marie Rognes wrote:
> I haven't got the foggiest, 

Modifying this statement a bit:

In the assembling of the matrices etc, the third coordinate is probably just
ignored. (At least the FFC generated code probably just ignores the third
coordinate). Try removing the last coordinate from your  mesh --
you'll get a very similar picture.

--
Marie

---

From: Harish Narayanan <[email-masked]>
Date: Fri, 18 Dec 2009 14:29:10 +0000

> that we could do that ;) )

This was my first surprise! I was grepping through some code and saw
some tdim, gdim variables and then stumbled across ("triangle", 2, 2)
somewhere.

I did the obvious, changed one of the 2s to a 3.

Harish

---

From: Harish Narayanan <[email-masked]>
Date: Fri, 18 Dec 2009 14:38:59 +0000

> you'll get a very similar picture.

This is probably what is going on. Without the third coordinate, the
domain (obviously) looks different, but the "solution" numbers look the
same. But most importantly, the essential prettiness of the plots is
retained.

Harish