
2009/4/29 Robert Cimrman <cimr...@ntc.zcu.cz>:
Hi again!
I have taken the isympy code (interactive sympy shell based on ipython), tweaked it, and called isfepy - the interactive sfepy shell. It is still very preliminary, but it opens new possibilities of how sfepy could be deployed, and even now it is usable for the basic stuff, like:
In [1]: pb, vec, data = pde_solve('input/poisson.py') In [2]: view = Viewer(pb.get_output_name()) In [3]: view()
[1] solves a Poisson equation in 3D by the finite elements, [2] constructs a mayavi2 viewer, and [3] displays the results using the mayavi's mlab.show(). Of course, [1] should work for other input files too.
In this way one can quickly run simple problem inputs and view the results immediately.
Could you try it, please, when you have some spare moments? The plotting
Definitely. Here is the output on Ubuntu Jaunty:
$ ./isfepy /home/ondrej/repos/sfepy/sfepy/base/base.py:11: DeprecationWarning: the sets module is deprecated from sets import Set /usr/lib/python2.6/dist-packages/scipy/linsolve/__init__.py:4: DeprecationWarning: scipy.linsolve has moved to scipy.sparse.linalg.dsolve warn('scipy.linsolve has moved to scipy.sparse.linalg.dsolve', DeprecationWarning) Python 2.6.2 console for SfePy 2009.1-release (94b4d939a418470edf4ce44d05f1e1a5ecf5e9a4)
These commands were executed:
from sfepy.base.base import * from sfepy.fem import * from sfepy.applications import pde_solve from sfepy.postprocess import Viewer
Try:
pb, vec, data = pde_solve('input/poisson.py') view = Viewer(pb.get_output_name()) view()
Documentation can be found at http://sfepy.org
In [1]: pb, vec, data = pde_solve('input/poisson.py') sfepy: left over: ['__builtins__', '__file__', '__name__', '_filename', '__doc__', '__package__'] sfepy: reading mesh (database/simple.mesh)... sfepy: ...done in 0.01 s sfepy: setting up domain edges... sfepy: ...done in 0.01 s sfepy: setting up domain faces... sfepy: ...done in 0.01 s sfepy: creating regions... sfepy: leaf Gamma_Right region_Gamma_Right sfepy: leaf Omega region_Omega sfepy: leaf Gamma_Left region_Gamma_Left sfepy: ...done in 0.01 s sfepy: equation "Temperature": sfepy: dw_laplace.i1.Omega( coef.val, s, t ) = 0 sfepy: setting up dof connectivities... sfepy: ...done in 0.00 s sfepy: describing geometries... sfepy: ...done in 0.00 s sfepy: using solvers: nls: newton ls: ls sfepy: matrix shape: (300, 300) sfepy: assembling matrix graph... sfepy: ...done in 0.00 s sfepy: matrix structural nonzeros: 3538 (3.93e-02% fill) sfepy: updating materials... sfepy: coef sfepy: ...done in 0.00 s sfepy: nls: iter: 0, residual: 1.176265e-01 (rel: 1.000000e+00) sfepy: rezidual: 0.00 [s] sfepy: solve: 0.01 [s] sfepy: matrix: 0.00 [s] sfepy: nls: iter: 1, residual: 1.005289e-16 (rel: 8.546445e-16)
In [2]: view = Viewer(pb.get_output_name())
In [3]: view() sfepy: ['t'] sfepy: [] sfepy: scalar t [ 1.22460595e-18 -1.00000001e-01 0.00000000e+00]
In [4]: Exiting ...
So things work, but the warnings are annoying.
Ondrej