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
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
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
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