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 …
[View More]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
requires mayavi2 (at least 3.1.0), but it is not mandatory - only the
step [3] will do nothing.
cheers,
r.
[View Less]
Hi all,
let me introduce two new things that sfepy can do now:
- boundary traces (see input/subdomains.py for full example)
Example: we wish to solve a Poisson problem (LaTeX notation), where a
domain is divided into two subdomains 1, 2, and a condition is specified
on the interface:
\Delta p_1 = g_1 in Omega_1
\Delta p_2 = g_2 in Omega_2
p_1 = p_2 + c on \Gamma_{12}
For this we define two fields (note the short syntax, added by Vlada
recently):
fields = {
'pressure1' : ((1,1), '…
[View More]real', 'Omega1', {'Omega1' : '2_4_Q1'}),
'pressure2' : ((1,1), 'real', 'Omega2', {'Omega2' : '2_4_Q1'}),
}
and two sets of variables (q1, p1), (q2, p2):
variables = {
'p1' : ('unknown field', 'pressure1', 0),
'q1' : ('test field', 'pressure1', 'p1'),
'p2' : ('unknown field', 'pressure2', 1),
'q2' : ('test field', 'pressure2', 'p2'),
}
Then the syntax of equations was enriched by the 'tr' keyword to denote
a trace:
equations = {
'eq_1' :
"""dw_laplace.ivol.Omega1( one1.one, q1, p1 )
+ dw_jump.isurf.Gamma12_1( jump.val, q1, p1, tr(p2) )
= 0""",
'eq_2' :
"""dw_laplace.ivol.Omega2( one2.one, q2, p2 )
+ dw_jump.isurf.Gamma12_2( jump.val, q2, tr(p1), p2 )
= 0""",
}
Gamma12_1 and Gamma12_2 are both the same interface region, but
Gamma12_1 has Omega1 as its "inside", Gamma12_2 has Omega2.
- mayavi2 based visualization
A new top-level script 'postproc.py' can be used to quickly view the
results. Run the tests, then call it with the test results as arguments
(assuming the tests passed):
$ ./runTests.py
$ ./postproc.py -h
$ ./postproc.py output-tests/test_poisson.vtk
$ ./postproc.py output-tests/test_navier_stokes.vtk
$ ./postproc.py output-tests/test_lcbc_2d.vtk
$ ./postproc.py output-tests/test_kostka.vtk --3d
To try it out, clone the sfepy git repository as described at [1]. You
also need ETS (mayavi2) [2].
Bug reports welcome!
r.
[1] http://code.google.com/p/sfepy/wiki/Downloads?tm=2
[2] http://code.enthought.com/projects/
[View Less]