Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert particle output into binary VTK XML #4386

Draft
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

BenWibking
Copy link
Contributor

@BenWibking BenWibking commented Mar 21, 2025

Summary

Converts AMReX particle output into binary VTK XML format.

Additional background

This is needed in order to efficiently read AMReX particle data in VisIt.
VTK documentation: https://docs.vtk.org/en/latest/design_documents/VTKFileFormats.html#serial-xml-file-formats.

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

@@ -1,4 +1,6 @@
import numpy as np
import struct
import os

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'os' is not used.
binfile.write(struct.pack('<L', arr.nbytes))
binfile.write(float_arr.tobytes('C'))

outfile = open(fname, 'a')

Check warning

Code scanning / CodeQL

File is not always closed Warning

File may not be closed if an exception is raised.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant