Ondrej Certik wrote:

On Thu, Jul 31, 2008 at 10:33 PM, rpmu...@gmail.com <rpmu...@gmail.com> wrote:

http://groups.google.com/group/sfepy-devel/web/fem-1d-eigen.pdf

My quantum chemistry background shows through here, as I'm just using the finite elements like a normal basis set, a "pointy" Gaussian, if you will, and computing matrix elements. This isn't the way that real FEA people solve problems, and I'm trying to understand what that entails. I know it's something like:

- create a mesh
- work out a bunch of integrals over the mesh elements
- then a miracle occurs
- write down your final solution
You do it exactly right in the paper. It's the same in 2D and 3D. I view FEM in the same way as you do, the mesh just defines a basis, you plug the basis in the equation, you get the matrix formulation, you solve it, you are done.

If you plugged the basis into the equation naively (e.g. directly), you'd get unsymmetric matrices, so you first integrate the equation per partes (or the green theorem, as you use in the paper).

We do not care so much about symmetry (we use UMFPACK, right?), but about the necessary smoothness of the function spaces. Laplacian requires C^2 - now you cannot use P1 (linear) elements for that! This is why per-partes and the integral formulation is done.

Mathematicians also say a lot of other things about weak solutions and stuff, but I found it's not really useful and it doesn't provide any more useful information for me besides the above.

It does.

My hope is that the simple 1d problems that I've provided are simple enough that it wouldn't be too much work for someone (Ondrej?) to show me how to implement them in sfepy. Thanks in advance for any help anyone can offer.

I am not sure if sfepy can solve 1D problems. 1D problems can be solved imho more efficiently by just integrating the ordinary differential equation. Ryan, do you know how to implement 1D stuff in sfepy?

Right, it is not there, and is not probably a worthy addition.

For 2D and 3D, see the schroedinger.py script, that implements the particle in the box and oscillator problems, both in 2D and 3D. Maybe it could be adapted to 1D as well, I never thought about that.

It could, do you want to take a stab? :)

Let me know if something is not clear in the script. If you are interested in the internals, I can also answer something that I understand and Robert can answer all the other details, as he programmed it in the first place.

I will answer, but my answers tend to be somewhat time-lagged. I do not carry my laptop all the time like you do ;)

r.