On Sun, Nov 25, 2012 at 11:45 AM, Robert Cimrman
On 11/24/2012 11:45 PM, Ondřej Čertík wrote:
On Wed, Nov 21, 2012 at 1:25 PM, Robert Cimrman
wrote: On 11/21/2012 08:52 PM, Ondřej Čertík wrote:
On Wed, Nov 21, 2012 at 10:08 AM, Robert Cimrman
wrote: I am pleased to announce release 2012.4 of SfePy.
Description ----------- SfePy (simple finite elements in Python) is a software for solving systems of coupled partial differential equations by the finite element method. The code is based on NumPy and SciPy packages. It is distributed under the new BSD license.
Home page: http://sfepy.org Downloads, mailing list, wiki: http://code.google.com/p/sfepy/ Git (source) repository, issue tracker: http://github.com/sfepy
Highlights of this release -------------------------- - initial support for hierarchical basis on quadrilateral and brick elements
Are there some examples of this? I would be curious to see how it works.
Yes, see [1]. The computation is as fast as with the Lagrange basis. What takes time is the linearization of the solution for visualization, as that is written in pure Python.
r. [1] http://sfepy.org/doc-devel/examples/diffusion/sinbc.html
Thanks. I was able to compile it and run it after applying the following patch:
diff --git a/examples/diffusion/sinbc.py b/examples/diffusion/sinbc.py index 9d30aed..7448191 100644 --- a/examples/diffusion/sinbc.py +++ b/examples/diffusion/sinbc.py @@ -31,7 +31,7 @@ from sfepy.fem import Mesh, Domain from sfepy.fem.meshio import UserMeshIO, MeshIO from sfepy.homogenization.utils import define_box_regions
-base_mesh = data_dir + '/meshes/elements/2_4_2.mesh' +base_mesh = data_dir + '/sfepy/meshes/elements/2_4_2.mesh'
def mesh_hook(mesh, mode): """
I just installed sfepy using the usual "python setup.py install", but I wasn't able to run it inside the tree, it was telling me:
Traceback (most recent call last): File "./simple.py", line 19, in <module> from sfepy.applications import PDESolverApp File "/home/ondrej/repos/sfepy/sfepy/applications/__init__.py", line 2, in <module> from pde_solver_app import (PDESolverApp, solve_pde, solve_evolutionary, File "/home/ondrej/repos/sfepy/sfepy/applications/pde_solver_app.py", line 7, in <module> from sfepy.fem import ProblemDefinition File "/home/ondrej/repos/sfepy/sfepy/fem/__init__.py", line 6, in <module> raise ImportError( msg ) ImportError: sfepy extension modules are not compiled! type "make"
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.
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. Thanks for answering the questions, I think it's becoming clear to me how it works now. Ondrej