Thanks for your help, Eric
On Wed, Jan 15, 2014 at 3:34 PM, Guyer, Jonathan E. Dr. < [email protected]> wrote: > On Jan 15, 2014, at 2:55 PM, Eric Bruning <[email protected]> wrote: > > > I'm calculating the gradient of a CellVariable using faceGrad: > > Efield = -phi.faceGrad > > and would like to plot the value of the magnitude of the vector as a > scalar field. > > > > Is there a simple way to do this? I can get locations of each of the > faces, but they don't naturally reshape into something I can display as an > image / pcolormesh - or if they do I couldn't find how to do it in the docs > or on a mailing list. > > FaceVariables can be tricky to visualize (actually vectors are easier than > scalars, generally) > I have a working vector plot, which I can color according to vector magnitude, so that also does most of what I need. I understand why the face values are tricky to visualize as they're staggered even for an ordinary grid. In the case of a simple thunderstorm charge distribution (see https://twitter.com/deeplycloudy/status/423575182997876736/photo/1), the vectors are so large between the charge layers that the vector plot is rather noisy and hard to interpret. Hence my desire for a simpler way to visualize the magnitude. > > An average of the values at each face for each cell of the underlying > mesh would be fine. > > That basically describes a plot of phi.grad.mag. Let us know if that > doesn't do what you want. > > I was having some misgivings about the first- vs. second-order discretization, hence my preference for phi.faceGrad, although you're correct that phi.grad would do what I want. More generally, I like to be able to understand the underlying coordinate geometry so I can do other things with the solution values. Thanks, Eric > > _______________________________________________ > fipy mailing list > [email protected] > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] >
_______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
