Hi Alec,
Not yet - we actually never saved a solution on a surface. I will try to fix
this issue now. Then, something like the following code should work (see [1]
for definition of d_surface_flux term, K is a permeability matrix):
1. Define a postprocessing function.
def post_process(out, pb, state, extend=False):
"""
Calculate fluxes.
"""
from sfepy.base.base import Struct
from sfepy.fem import extend_cell_data
ev = pb.evaluate
flux = ev('d_surface_flux.2.Gamma(m.K, t)', mode='el_avg')
flux = extend_cell_data(flux, pb.domain, 'Gamma') # Extend to whole domain
- this does not work now.
out['flux'] = Struct(name='output_data', mode='cell',
data=flux, dofs=None)
return out
2. Add the function to the options:
options = {
'post_process_hook' : 'post_process',
}
> 2. Suppose we solve pure Dirichlet problem (no Neumann conditions). We need
> to specify essential boundary conditions on the all surface nodes? What is
> the best way to select all surface nodes?
You can use the following region definition:
regions = {
'Gamma' : ('nodes of surface', {}),
}
to select all the surface nodes.
> 3. Suppose the Neumann boundary conditions is not zero. In this case we
> need to add surface integral with the flux. Do we need to add new term for
> the flux in the problem description? And this term will be the surface
> integral but in the problem description we have only tetrahedral domain 3D
> mesh. What is the best way to select only surface part of the mesh for the
> surface integration?
Yes, you need to add the flux term "dw_surface_ndot.2.Gamma(m.c, s)" to the
equation, where m.c. is the given flux (a material), and s is the test
function, again check [1], c is the flux vector. As for the surface selection -
see above.
See also example [2] - linear elasticity with surface tractions.
Cheers,
r.
[1]
http://sfepy.org/doc-devel/terms_overview.html
[2]
http://sfepy.org/doc-devel/examples/linear_elasticity/linear_elastic_tractions.html