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:
1. 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)',
print "Flux, entire surface:", np.sum(flx), flx.max(), flx.min()
snkf = pb.evaluate('d_surface_flux.2.Gamma_Left(coef.sigma, t)',
print "Sink flux: ", snkf
srcf = pb.evaluate('d_surface_flux.2.Gamma_Right(coef.sigma, t)',
print "Source flux: ", srcf
blkf = pb.evaluate('d_surface_flux.2.Gamma_N(coef.sigma, t)',
print "Block flux: ", blkf
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?
2. 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,
I followed the interactive example in sfepy tutorial and wrote my custom
simulation script for the block domain with body force (t2 term). That
works. But for the point loaded block model (t3 term), I can't make it
work. The script stopped at "assert_(mat.shape[-1]==virtual.dim)" of
terms_point.py with IndexError: tuple index out of range. Searching the
web does not find help information for this.
The reason I write the attached custom simulation script is that I failed
doing the things below:
the "non-custom" script for a point loaded block running with "simple.py"
works and gmsh can mesh different geometries. I would like to finish those
two things together in python like "os.system('gmsh ........')", and
"os.system('simple.py examples/myscript.py") but errors to import config
in simple.py got me there since "path" settings for import in simple.py
seems a little complicated for me. The custom simulation script might be
easier to setup import "path" for me.
Thanks for your help.