30 Aug
2012
30 Aug
'12
5:03 a.m.
On 08/30/2012 11:08 AM, David Libault wrote:
Robert,
Understood. I was not using the correct "mode" for what I was expecting. Now the user interface looks nice.
David.
Nevertheless, it should be documented (-> Issue 196).
So this is my current testing function, that shows how to save the fluxes (they are displayed over the triangles that contain the boundary edges...):
def post_process(out, pb, state, extend=False): from sfepy.base.base import Struct from sfepy.fem import extend_cell_data
electric_field = pb.evaluate('ev_grad.i1.Omega( v )', mode='el_avg')
out['electric_field'] = Struct(name='Electric field', mode='cell',
data=electric_field, dofs=None)
flux1 = pb.evaluate('d_surface_flux.2.Gamma_Left(coef.sigma, v)',
mode='el')
print flux1
print flux1.sum()
flux1 = extend_cell_data(flux1, pb.domain, 'Gamma_Left', val=0.0,
is_surface=True)
out['flux1'] = Struct(name='output_data', mode='cell',
data=flux1, dofs=None)
flux2 = pb.evaluate('d_surface_flux.2.Gamma_Right(coef.sigma, v)',
mode='el')
print flux2
print flux2.sum()
flux2 = extend_cell_data(flux2, pb.domain, 'Gamma_Right', val=0.0,
is_surface=True)
out['flux2'] = Struct(name='output_data', mode='cell',
data=flux2, dofs=None)
print pb.evaluate('d_surface_flux.2.Gamma_Right(coef.sigma, v)')
return out
r.