# Plot fields with Vorpal Plotter

It occurred to me that it might be fairly straight forward to plot the fields on top of the block plots. It turns out that it is!

### Update

- Interpolates fields and grid bounds to plot them more accurately.
- Fixed field arrow plots (so the arrows point in faintly the right direction)
- Fixed some of the over plotting issues. STL and contour are now compatible.

### Plot Fields

I’ve put in two ways of plotting fields over the blocks. A relatively normal vector arrow plot and a field magnitude “ultimate” 3D contour plot.

fields.fieldPlot('deymittraSphere_YeeElecField_1.h5',scale, origin,0.1e-4); fields.ultimateContour('deymittraSphere_YeeElecField_1.h5',origin, cells, length);

The contour plot is generated using the magnitude of the field vector. I’ve cheated a little as I’ve just rescaled the plot so the node values that I’ve now plotted as volumes fit in the right place. I should really have interpolated to the centre of the cells and plotted that. This is close though. I’ve set up some fairly simple minded interpolation, the plots fit rather better now.

These can of course be combined with the block plotting function to make something quite instructive.

### Plot GridBounds

If you aren’t using an stl I’ve put in a way of plotting the stair step mesh used by vorpal (I couldn’t quite work out the cut-cell mesh format). I’m not convinced it’s an accurate representation, it has the same fiddle as the ultimate contour. I’ve interpolated this and the grids fit to the rest of the data far better.

plotMesh.plotGridBounds('deymittraSphere_sphere_1.h5',origin, cells, length);

Sadly plotGridBounds and ultimateContour are not compatible. One appears to wipe out the other. *plotGridBounds *and *ultimateContour *and *plotStl *are a bit more compatible now, YMMV.

### Plot Points

I’ve also added *position *and *point* to the plottable entities in plot blocks. Now you can plot various histories such as *fieldOnCoords* by editing the *plotList*.

### Examples

All these examples are in *example/* in the archive.

### Old version

- Plots fields incorrectly
- No interpolation on field plots.