-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Add xdmffile read function #3536
base: main
Are you sure you want to change the base?
Add xdmffile read function #3536
Conversation
…oni/add_xdmffile_read_function
…-pf/dolfinx into mleoni/add_xdmffile_read_function
Wouldn't it be sufficient to read in the "vertex_data" as a MeshTags object (using |
@jorgensd This is not possible, as far as I can tell, because
so |
NOTE: This PR is meant to be stacked onto #3533 . The diff of this PR shows the edits of both but the only new changes are the ones related to the function
XDMFFile::read_function
. The rest of the diff will disappear once #3533 is merged and this PR is rebased ontomain
but I am uploading it now so it can be reviewed immediately.This PR introduces much-needed functionalities that let a user read a function from file. This is vital in most scenarios in which a Finite Element element simulation is part of a bigger pipeline and needs to read input data produced by other software.
This PR adds a
read_function
routine to the classXDMFFile
that can read a P1 function from an XDMF file exploiting the fact that the degrees of freedom of a P1 function are the mesh vertexes and that we can now read a [double
-valued] meshtag defined on vertexes, so we can define a P1 function.The implementation closely follows the normal
read_meshtags
function but reads vertex data instead and, as a last step, copies the data in a function'sarray
in the correct position.Co-implemented with @jorgensd .