Hi Robert,
I'm new to sfepy and having a good experience so far. But I've been having some issues understanding the d_surface_flux function.. a couple of questions that might help:
- In the poisson_neumann example, if I add a post_process function which evaluates various surface fluxes the results are not what I would expect. Here is my post_process function:
def post_process(out, pb, state, extend=False): from sfepy.base.base import Struct
flx = pb.evaluate('d_surface_flux.2.Gamma(coef.sigma, t)',
mode='el_avg') print "Flux, entire surface:", np.sum(flx), flx.max(), flx.min()
snkf = pb.evaluate('d_surface_flux.2.Gamma_Left(coef.sigma, t)',
mode='eval') print "Sink flux: ", snkf
srcf = pb.evaluate('d_surface_flux.2.Gamma_Right(coef.sigma, t)',
mode='eval') print "Source flux: ", srcf
blkf = pb.evaluate('d_surface_flux.2.Gamma_N(coef.sigma, t)',
mode='eval') print "Block flux: ", blkf
return out
I would expect that "Flux, entire surface" would be approximately zero, and the sink flux and source flux should be approximately equal but opposite sign, and block flux to be zero. Since Gamma_N is supposed to have a zero neumann condition on it my understanding is that flux would only be present over Gamma_Left and Gamma_Right and that they would be equal but opposite sign. What am I missing here?
- If I compute surface_flux using mode='el_avg' and then sum the results, why is that number not equal to surface_flux computed with mode='eval'? Whats the difference?
Thanks for your help,
Geoff