On 08/03/2014 05:44 PM, Geoff Wright wrote:
Hi Robert,
I will try this tomorrow and let you know. My platform is 64bit Ubuntu, I cloned the repo on 7/22 so I'm at revision 433a3bc2a6a84d93145b04ee7d3debb493de0e50.
The linear system converges nicely and the voltage values look nice and smooth so I don't think there is anything grossly wrong. I think theres some issue with how flux is being integrated that is not exposed with the flat cylinder example.
I tried a similar test with a simple cube on Friday, and the results were correct when I had the source and sink on opposing faces of the cube. However, once I included more of the orthogonal faces in the source, I saw the issue again. I'll post the mesh and the python script for this tomorrow.
One more thing I wanted to try is to look at the flux values across the whole surface under some of these scenarios. I understand that I can pull out the surface values using mode='el', and same them in the vtk output file. But I'm not sure how to map them back to the appropriate vertex positions in order to visualize the flux. Can you suggest the best way of doing this? I'll post a screenshot once I have it.
Something like this?
from sfepy.discrete.fem.utils import extend_cell_data
aa = pb.evaluate('d_surface_flux.2.Gamma_Left(coef.sigma, v)', mode='el')
flux = extend_cell_data(aa, pb.domain, 'Gamma_Left', is_surface=True)
out['flux'] = Struct(name='flux field', mode='cell', data=flux, dofs=None)
It averages the surface data from faces into cells of those faces (so it is wrong here: the fluxes should be summed, not averaged; it's ok for non-corner faces, i.e. a cell must have a single surface face). The cell data can then be saved normally.
Otherwise the regions can be accessed:
pb.domain.regions reg = pb.domain.regions['Gamma_Left'] print reg reg.vertices ...
The vertices are indices into the mesh vertices, so to get their coordinates, just use pb.domain.cmesh.coors[reg.vertices] etc.
Is that what you asked for? :)
r.