hermes1d

2 views
Skip to first unread message

Ondrej Certik

unread,
Mar 8, 2009, 12:47:55 AM3/8/09
to hpfem
Hi,

today Pavel and me were departing from Miami with Brian and we thought
what to do with our hermes1d link on our pages and then we said, hey,
let's just write hermes1d, right now. So we started coding at 4:45am
(pacific time) and it was very productive. After many hours of hard
work, here is the result:

http://nb.hpfem.org/home/pub/17/

It solves the second order ODE equation with FEM:

y'' + y = 0
y(0)=0; y'(0)=1

Notice the nonstandard (for FEM) boundary/initial condition.

I don't recall seeing such a thing anywhere else (if you know some
other codes that can do it, please point me, I am very interested in
studying them), as most people would just use 4th order Runge-Kutta or
something like that. But we really like FEM. The code allows any
linear, quadratic, cubic, up to 10th order elements and any number of
equations (linear or nonlinear), but it doesn't yet have an hp
refinements and most likely contains some bugs, so it still needs some
polishing before we can include it as our default 1d solver linked
from hpfem.org, however since I will be very busy the next week, I am
posting the source code here already so that you can already give it a
shot:

http://github.com/certik/hermes1-dev

If you look at the first commit at 4:45am (remember Miami is +3
hours), it was a busy day --- but I would never imagine that I will be
running it in the notebook in the evening!

The code is still in development, see our todo list in the README. It
is BSD licensed, currently in pure Python, but later after we
implement hp-FEM and get all the pieces in shape, we'll write the core
in C++ and I am really curious how it is going to stand with the other
traditional ODE solvers.

I am now writing some notes about it in latex while I still remember
it, will post it here soon. I am really glad I joined our group here
in Reno -- I remember that I spent many days trying to get the 1d FEM
run for more nontrivial cases and it just difficult to get all the
things right. With Pavel next to me, it was just 1 day of work --
that's the power of the know-how.

Ondrej

Ondrej Certik

unread,
Mar 8, 2009, 3:59:42 AM3/8/09
to hpfem
> I am now writing some notes about it in latex while I still remember
> it, will post it here soon.

Attached find the .tex and .pdf. It's just a draft, that should be
greatly improved, but I decided that today I'll do my best to power
off my computer before midnight. :)

Any help with the notes is appreciated.

Ondrej

hermes1d.tex
hermes1d.pdf

Pavel Solin

unread,
Mar 10, 2009, 12:57:25 AM3/10/09
to hp...@googlegroups.com
I added some motivation why we do this at all,
as well as a brief description of the implicit
ODE formulation, boundary conditions, weak
formulation, FE discretization, and Newton's
method. There are two incomplete sections
at the end, "Numerical examples" and "TODO
list".

Pavel

--
Pavel Solin
University of Nevada, Reno
http://hpfem.math.unr.edu/people/pavel
Visit the Hermes project http://hpfem.org
hermes1d.pdf
hermes1d.tex

Ondrej Certik

unread,
Mar 10, 2009, 10:10:50 AM3/10/09
to hp...@googlegroups.com
On Mon, Mar 9, 2009 at 9:57 PM, Pavel Solin <so...@unr.edu> wrote:
> I added some motivation why we do this at all,
> as well as a brief description of the implicit
> ODE formulation, boundary conditions, weak
> formulation, FE discretization, and Newton's
> method. There are two incomplete sections
> at the end, "Numerical examples" and "TODO
> list".

Great job! Thanks!

Another thing into the todo list is:

* in some particular cases, like y'' + y=0, I believe it is possible
to solve the equation *without* the newton iteration, so we should
explore this idea.

Of course, our general way works (or should work) for almost any set
of ODE, so that should be our default way.

Ondrej

Pavel Solin

unread,
Mar 10, 2009, 12:06:08 PM3/10/09
to hp...@googlegroups.com
Sure, we can refine many things. For example, if the Newton's
method does not converge, then we can calculate some coarse
approximation using implicit Euler, project it to the
finite element space, and use it as an initial condition for
Newton. Right now we start from the zero vector, which is not
the best thing to do.

Pavel

--
Pavel Solin
University of Nevada, Reno
http://hpfem.math.unr.edu/people/pavel
Visit the Hermes project http://hpfem.org


Ondrej Certik wrote:

Ondrej Certik

unread,
Mar 10, 2009, 12:10:32 PM3/10/09
to hp...@googlegroups.com
On Tue, Mar 10, 2009 at 9:06 AM, Pavel Solin <so...@unr.edu> wrote:
>
> Sure, we can refine many things. For example, if the Newton's
> method does not converge, then we can calculate some coarse
> approximation using implicit Euler, project it to the
> finite element space, and use it as an initial condition for
> Newton. Right now we start from the zero vector, which is not
> the best thing to do.

Ah, that's a great idea. When I get some free time, I'll add it as
some idea for a project to hpfem.org, or our group. I think this could
be of an interest to some students.

Ondrej

Reply all
Reply to author
Forward
0 new messages