On Aug 13, 2008, at 11:36 AM, Rashmi Ranjan Mohanty wrote:
How to plot mass flux across the mesh in one dimension?
flux = M * chemPotential.getFaceGrad()
It may be a really trivial question,but I could not plot it.
This seems to be a case we never considered. Rank-1 fields can be
plotted in 2D, but not in 1D. If you're still using FiPy 1.2, you
actually can do
viewers.make(vars=M * chemPotential.getGrad())
but this doesn't work on trunk/ because of the reordering we did on
the data stores.
I could print it to a file using TSVViewer, but even then it prints
flux value at mesh nodes rather than cell centers.
I'm not sure why that's a problem. The flux is defined at the faces
between cells, not at the cell centers.
Nonetheless, plot `M * chemPotential.getGrad()` if you want a
reasonable interpolation at cell centers.
I'm not seeing a quick fix to this, but have filed a ticket at http://www.matforge.org/fipy/ticket/148
so that we deal with it. If it were me, I'd use TSVViewer (either on
faces or cells) and plot with something else.