Coordinates to grid cells in Vorpal

Download gridCoords.mac

I’ve written a macro with a few useful functions to convert between coordinates (in meters) and cells (in…cells). It makes it a bit neater for those blocks which insist on being defined on the grid.

So something horrible like:

lowerBounds = [$int(floor((-XSTART-WG_A/2.)/DX))$ $int(floor((InWGCoupleOffSetY-YSTART)/DY))$ $int(floor(OutWGOffsetZ/DZ))$]

upperBounds = [$int(ceil((-XSTART+WG_A/2.)/DX))$ $int(ceil((InWGCoupleOffSetY-YSTART)/DY))+1$ $int(ceil((OutWGOffsetZ+WG_B)/DZ))$]

turns into something vaguely readable like:

lowerBounds = toGridFloorA(-WG_A/2.,InWGCoupleOffSetY+YSTART,OutWGOffsetZ)

upperBounds = toGridCeilA(WG_A/2.,InWGCoupleOffSetY+YSTART,OutWGOffsetZ+WG_B)

toCoords(x,dx,xstart) should convert the other way from cells to coordinates.

Read More

pyVorpal

PyVorpal-1.2.2

  • Uses VorpalDom
  • Extracts all or some blocks which can be plotted
  • Creates a Visit friendly .h5 file
  • There must be a .in file
  • VorpalComposer/VisIt can’t plot meshs with 0 or 1 cells in any dimension (at least on windows). As a workaround these are set to have 2 cells for plotting. It’s better than nothing for now.

With VorpalComposer you can integrate block plotting with the inbuilt visualisation. As the blocks are saved to an .h5 file as a mesh VorpalComposer lists the blocks as mesh’s and is able to plot them.

Plot the blocks as well as the fields in VorpalComposer

If you “Enable VisIt Context Menu” under “Visualisation Options” in Tools/Settings you can right click on the visualization pane and open the visit GUI. This lets you edit the colours and opacity of the plot.
Read More