Viewing data generated by AWS Palace
The Palace simulation API produces .pvd and .vtu files corresponding to the field data. This can be viewed via Paraview or the in-built utility as follows:
from SQDMetal.PALACE.PVDVTU_Viewer import PVDVTU_Viewer
data_path = 'output_example/paraview/eigenmode/eigenmode.pvd'
#Create the viewer object from the generated datasets
leView = PVDVTU_Viewer(data_path)
#Create a 2D slice of the 3D dataset
leSlice = leView.get_data_slice(data_set_index=0, slice_plane_normal=np.array([0,0,1]), slice_plane_origin=np.array([0,0,0]))
#Gather and plot the magnitude of the z-component of the electric field: E_z
data = leSlice.get_data('E_real')[:,2]
fig = leSlice.plot(data, 'coolwarm', True)
#Gather and plot the magnitude of the electric field: |E|
data = np.linalg.norm(leSlice.get_data('E_real'), axis=1)
fig = leSlice.plot(data, 'coolwarm', True)