Subject: [puffin-dev] User-supplied data format for puffin

From: LUK ShunTim <[email-masked]>
Date: Fri, 03 Feb 2006 17:06:20 +0800

Hello,

I'd like to try out puffin as a teaching tool for finite elements.
The m-files are quite readable but I cannot (fully) figure out the data
formats of user-supplied stuff. I take "PoissonSolver.m" with "square.m"
as example.

points: x, y
(My guess: x, y - Nodal co-ords)

triangles: i, j, k, d
(My guess: i, j, k - Connectivity for the element. d - assigned as
"d=triangle(4)" in AssembleMatrix.m and AssembleVector.m and called
"current domain number" in the manual. Would allow different
user-supplied function f in different sub-domains/elements.

edges: i, j, ?, ?, d, ?, ?
(my guess: i,j - start and end node number of the edge? d - assigned as
"d=edge(5)" in AssembleMatrix.m and AssembleVector.m and called "current
edge number" in the manual. Should be integer but it's floating point
number in "square.m". I can't figure out the rest.)

That's the best I can arrived at now.

I think a set of example data files (mesh and user-supplied functions)
where there is a combination of essential and natural boundary
conditions will be great.

Thanks in advance and regards,
ST
--

---

From: Anders Logg <[email-masked]>
Date: Fri, 3 Feb 2006 10:00:32 -0600

> (My guess: x, y - Nodal co-ords)

Correct: p is the list of coordinates (x,y) for the vertices of the
mesh.

> user-supplied function f in different sub-domains/elements.

Correct again: the first three are the vertices for the triangle, and
the fourth is the domain number. This variable is passed to the
user-supplied definition of the bilinear or linear form, so all
functions in the form like source terms or coefficients can depend on
d and be different in different domains.

> number in "square.m". I can't figure out the rest.)

Correct: the first two are vertex numbers and the fifth is the number
of the corresponding part of the boundary (there are four for the
square), so that a boundary integral can depend on the boundary
number.

The other ones you don't need to worry about. Number three and four
give a parametrization of the boundary part (parameter t goes from 0
to 1 on each part of the boundary). I have no idea what the other two
are for.

Anyhow, Puffin only uses the first two and the fifth and ignores the
rest. The meshes are generated with MATLABs PDE toolbox and this
happens to be the format it spits out.

> conditions will be great.

The idea for Puffin is to implement all boundary conditions weakly:

  - a du/dn = gamma (u - gd) + gn

With gamma large, one obtains the Dirichlet condition u = gd.

This makes it easy to implement different boundary conditions for
different parts of the domain by just choosing gamma, gd and gn.

> Thanks in advance and regards,

Maybe you've already discovered the exercises. Otherwise, take a look
at the section F exercises at

    http://www.bodysoulmath.org/sessions/

Good luck!

/Anders

---

From: LUK ShunTim <[email-masked]>
Date: Sat, 04 Feb 2006 21:13:30 +0800

> On Fri, Feb 03, 2006 at 05:06:20PM +0800, LUK ShunTim wrote:

[snipped]

> happens to be the format it spits out.

I see. I can check their documentation as they are on-line.

>     http://www.bodysoulmath.org/sessions/

No, but will definitely check them out.

> /Anders

Thanks very much,
ST
--