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

Support list of DG-0 + other space in VTXWriter #3375

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ordinary-slim
Copy link

Continuation of #3107 so that we're able to output both DG0 + another space in the same bp file. The previous PR by @jorgensd says:

I've decided to keep it such that only single function-space functions should be saved in a single bp file.
This could of course be changed now, to store a mixture of DG-0 and a single other element function.

This is up for discussion.

Since VTX is the recommended writer, I think it's necessary to support this feature. This code doesn't modify previous behavior regarding the written post files.

MWE

from dolfinx import fem, mesh, io
from mpi4py import MPI

cells_per_side = 4

domain  = mesh.create_unit_square(MPI.COMM_WORLD,
                                  cells_per_side,
                                  cells_per_side,
                                  )

cg1 = fem.functionspace(domain, ("Lagrange", 1),)
dg0 = fem.functionspace(domain, ("Discontinuous Lagrange", 0),)

u_cg1 = fem.Function(cg1, name="u_cg1")
u_dg0 = fem.Function(dg0, name="u_dg0")

expression =  lambda x : x[0]*x[1] 
u_cg1.interpolate(expression)
u_dg0.interpolate(expression)

writer = io.VTXWriter(domain.comm,
                      "result_folder/post.bp",
                      output=[u_cg1,u_dg0])
writer.write(0.0)
writer.close()

@jorgensd
Copy link
Member

jorgensd commented Sep 2, 2024

Currently DG-0 support in VTX is limited by: ornladios/ADIOS2#4179

@ordinary-slim
Copy link
Author

Currently DG-0 support in VTX is limited by: ornladios/ADIOS2#4179

Thank you for the information, a bit of a bummer. This PR could still be useful for steady data.

@mscroggs mscroggs added this to the 0.10.0 milestone Sep 3, 2024
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.

4 participants