read output files
-
hi
after simulation completed saved files :
input.h5
output.h5i want to use python to read the output data voltages x,y,z as generated after simulation completed
-
Hi,
I would recommend to perform the postprocessing in the GUI first, then right-click in the Explorer window of the Analysis tab and select "To-Python" in the context menu. This will generate a script (visible in the Scripter window) that reproduces your postprocessing pipeline. You can then modify the script to your liking. -
solved with h5py read :
import h5pywith h5py.File(fname,'r') as hdf:
FieldGroups=hdf['FieldGroups']
keygroup = list(FieldGroups.keys())
valField = FieldGroups[keygroup[0]]
AllFields = valField['AllFields']
EMPotential = AllFields['EM Potential(x,y,z,f0)']
EMPotentialObject = EMPotential['_Object']
AdditionalFieldDataCollection =
EMPotentialObject['AdditionalFieldDataCollection']
Snapshots = EMPotentialObject['Snapshots']
Potential = Snapshots['0']['comp0']#(n, m, k, 2) numpy array PotentialData = Potential[()]==========
this can be plotted
import pyvista as pv
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login