Plot3D - matthew-hennefarth/CPET GitHub Wiki

We can use the plot3d key to specify a volume where we want to plot the electric field within. This gives us an idea of what the electric field looks like in some region.

Simple Command

Using a simple command, we can specify

plot3d 4 4 4 box 1.5 1.5 1.5

where the first 3 integers after plot3d represent the density of points in the 3 directions respectively. The last arguments are used to construct the volume in which to plot. Hence in the example given, it will construct a 3x3x3 Angstrom box at the origin, with a total of 2*4+1 (ie 9) points in each direction, yielding 729 total points. The simple command will also automatically show the plot using gnuplot using standard options.

Block Command

We can specify the plot3d block using the % signifier. Furthermore, the following are the available options

%plot3d
    show true # or false if you do not want to view it in gnuplot
    volume box 1.5 1.5 1.5 # Required: again specifies the volume to plot within
    density 3 3 3 # Required: specifies the density (same as in simple)
    output volume.dat # specifies an output file to store the data in. 
end

Note that only the volume and density are required. show and output are optional arguments.

Density

The way the density works is this: if the density in direction x is d, and the side length of the box specified is s, then s/d yields the step size in the direction x to take. Hence 2*s is the actual side length of the box, and including the endpoint yields 2*d+1 total points.