On 11/25/2012 09:16 PM, Ondřej Čertík wrote:
On Sun, Nov 25, 2012 at 11:45 AM, Robert Cimrman cimr...@ntc.zcu.cz wrote:
So you installed sfepy system-wide, and then tried to run ./simple.py in the directory with sources, right? For running ./simple.py in the source directory, you need to build in placem by either running "make" as suggested in the error, or by the usual:
python setup.py build_ext --inplace
So I just copied ./simple.py and sinbc.py out of the tree (into /tmp) and applied the patch above and things started to work.
I have a few more basic questions so that I fully understand sfepy's terminology:
What kind of basis functions does it use? I looked it up here:
http://sfepy.org/doc-devel/src/sfepy/fem/poly_spaces.html
"Lagrange elements" are just the usual Lagrange interpolation polynomials with nodes at Gauss-Lobatto points?
What exactly are the "Lobatto" shape functions? Are those the "integrated Legendre polynomials"? Is this basis also called "hierarchical"?
I noticed that the refined mesh uses (first order) hanging nodes? I assume the hanging nodes only work with the "Lobatto" shape functions? (That's why you commented that the computation is as fast as with the Lagrange basis.)
The "Lagrange" basis corresponds to the usual nodal basis, where DOFs are equal to function values at the nodes and Lagrange polynomials are used for interpolation. No Gauss-Lobatto points are involved here, the nodes are distributed uniformly over reference elements.
Ah, I see. Interesting. In our code, we were using nodal basis, but the nodes were at Gauss-Lobatto points, not uniform. For just interpolation, I think it's better to use Gauss-Lobatto points rather than uniform points, i.e. due to:
http://en.wikipedia.org/wiki/Runge's_phenomenon
but as far as FE basis goes, that should be equivalent, maybe the conditioning of the matrix changes a bit. So I don't know which one is better.
I am using mostly linear elements. Moreover due to Issue 205 the Lagrange basis is usable only for orders 1 and 2 anyway, so I guess for those the points are the same. :)
The "Lobatto" basis is the hierarchical basis as described in Solin's book, so yes, it is built from integrated Legendre polynomials.
Got it.
As concerns the "hanging nodes", note that what you see there is just the result of the linearization, necessary for displaying higher order fields using VTK - there are no hanging nodes during solution. SfePy currently supports only uniform polynomial order and no hanging nodes during computation. Profound changes (and much more low-level coding instead of Python) would be required to support hanging nodes and varying order, as in hp-FEM - this cannot be easily vectorized by NumPy.
Ah, got it. I need to figure out how to plot the refined mesh, to see how sfepy is refining the mesh.
I have implemented something in the spirit of [1], but tried to vectorize it using numpy. Still, a loop remains there, so cythonizing that should help.
Thanks for answering the questions, I think it's becoming clear to me how it works now.
You are welcome.
r.
[1] Int. J. Numer. Meth. Engng 2007; 69:750–771