Okay yeah that works -- thanks!

Geoff



On Thursday, August 7, 2014 4:43:08 PM UTC-4, Geoff Wright wrote:
Hi Robert,

Me again :) but I think this one is easy...  in the previous thread about flux I was computing electric field from voltage in the post processing step.  I would like to compute energy density also, from electric field.  I believe its something like this, in the post_process hook:

    # compute the electric field
    electric_field = pb.evaluate('ev_grad.i1.Omega( v )', mode='el_avg')
    electric_field *= -1.0
    out['electric_field'] = Struct(name='Electric field', mode='cell', data=electric_field, dofs=None)

    # compute the energy density
    energy_density = pb.evaluate('dw_volume_dot.i1.Omega(p.sigma, ef, ef)', ef=electric_field)
    out['energy_density'] = Struct(name='Energy density', mode='cell', data=energy_density, dofs=None)


However, I get an error when its parsing the variables.  How do I specify ef variable properly?  I attached the relevant files in case its necessary.

Thank you,

Geoff