update: boundary traces, mayavi2 based visualization
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), '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/
participants (2)
-
osman
-
Robert Cimrman