def post_process(out, problem, state, extend=False):
"""
Calculate gradient of the solution.
"""
flux = problem.evaluate('d_surface_flux.2.Gamma_Top(coef.val, t)',
mode='eval', copy_materials=False, verbose=False)
print flux
When I call this using my rather complicated materials definition in the attached file, d_surface flux fails with the following error:
File "/Users/philcummins/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/sfepy/discrete/functions.py", line 114, in get_constants
nqp = qps.shape[ig][1]
KeyError: 1
materials = {
'flux' : ({'val' : 0.03},),
'coef' : ({'val' : 1.0},),
}
Then d_surface_flux appears to evaluate OK, but it just returns a single value of zero. (I am expecting a vector). I'm not sure what to try next, any suggestions?
Many thanks
- Phil
P.S. I have also attached a coarsened mesh file, in case anyone wants to try to run it. But you need to remove the "2km" in the name of the mesh file in flndrs2d.py if you want it to work.