Custom 3D plots

Create a custom 3D plot from custom data sets (Plot not defined in Roxie)

Download Input files

Setting up

Standard Loading of input, Parsing and Initializing RoxiePlotOutputs object

from roxieapi.commons.roxie_constants import PlotLabels
from roxieapi.commons.types import Plot3D
from roxieapi.output.plots import RoxiePlotOutputs

plots = RoxiePlotOutputs(
    "../input_files/dipole_3d.post.xml", "../input_files/dipole_3d.data"
)
parser = plots.output

Show all defined 3D plots dataset

Load 3D plot and get plot information

step = parser.find_transstep(1, 1)
assert step is not None
print("Defined 3D plot Data:")
for col in step.coilData3D.columns[1:]:
    lbl, desc = PlotLabels.lbl_desc_plot3D(col)
    print(f"  Id: {col}, Label: {lbl}, Description: {desc}")
Defined 3D plot Data:
  Id: cut, Label: , Description: Unknown label cut
  Id: 1, Label: PB, Description: Pressure on broad face of cable, positive away from pole (N/mm**2)
  Id: 2, Label: PN, Description: Pressure on Narrow face of cable, positive in outward direction (N/mm**2)
  Id: 3, Label: FX, Description: Lorentz force in x direction / surface area (N/mm**2)
  Id: 4, Label: FY, Description: Lorentz force in y direction / surface area (N/mm**2)
  Id: 5, Label: FZ, Description: Lorentz force in z direction / surface area (N/mm**2)
  Id: 6, Label: FR, Description: Lorentz force in radial direction / surface area (N/mm**2)
  Id: 7, Label: FF, Description: Lorentz force in azimuthal direction / surface area (N/mm**2)
  Id: 8, Label: BMAX, Description: |B| max (T)
  Id: 9, Label: BMIN, Description: |B| min (T)
  Id: 10, Label: BMID, Description: |B| average (T)
  Id: 12, Label: JZ, Description: Iz (A)
  Id: 13, Label: CURVMIN, Description: Min. curvature k (1/mm)
  Id: 14, Label: CURVMAX, Description: Max. curvature k (1/mm)

Create the plot description

p3d = Plot3D.create("Custom 3D Plot for FR")
p3d.add_coilPlot("6")
assert p3d is not None

Create the plot

figure = plots.plots3d.plot_3d(p3d)
figure.show()
plot 3d custom

Total running time of the script: (0 minutes 6.420 seconds)

Gallery generated by Sphinx-Gallery