-
Notifications
You must be signed in to change notification settings - Fork 7
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
Time dependency and multiple functions per file #49
Conversation
Add adios4dolfinx backwards compatibility
@francesco-ballarin do you mind reviewing and testing this PR with any of your existing checkpoints (turning |
@jorgensd Thanks, I'll give it a try tomorrow (Wed) morning! |
@@ -37,6 +37,18 @@ For scalability, the code uses [MPI Neighbourhood collectives](https://www.mpi-f | |||
- Reading and writing meshtags associated to meshes `adios4dolfinx.read/write_meshtags` | |||
- Reading checkpoints for any element (serial and parallel, one checkpoint per file). Use `adios4dolfinx.read/write_function`. | |||
|
|||
> [!IMPORTANT] | |||
> For a checkpoint to be valid, you first have to store the mesh with `write_mesh`, then use `write_function` to append to the checkpoint file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had missed that, I'll fix my I/O. I guess my RBniCSx test didn't see that because I am using builtin meshes, so even if I was not reading them in I was assured (except for changes in upstream dolfinx) that the mesh was the same anyways?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, what will happen if the user tries to call read_function
passing as argument a dolfinx.fem.Function
defined on a mesh that is not the one obtained with read_mesh
on the same file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To give you more context, in my use cases I would have the user read the mesh from a mesh checkpoint file, and then read time dependent solutions corresponding to (say) 100 different solves of a time dependent problem on 150 time steps. The 100 different solves are obtained e.g. for different coefficients in the PDE.
Each of the 100 problems, and each of the 150 time instances of the same problem, share the same mesh. The time history associated to solutions of problem 1 will be stored in checkpoint file 1 with the new time dependency feature. However, solutions of problem 2 will be stored in checkpoint file 2, and not appended at the end of checkpoint file 1, because they don't belong together (time would jump back to zero at the beginning of problem 2).
Do I need to have 100 copies of the mesh (i.e., one for every checkpoint file)? This IMPORTANT
block seems to say so, but since we started this discussion I'd rather double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new features, you could store all the checkpoints in the same file, as they have their own time dependency array.
I cannot support reading the mesh from another file, as the ordering of cells might differ if they are in another input file (and also the very crucial cell permutations for vector-spaces).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Add support for time dependent and multi-function files.
Backward compatibility added by introducing a
legacy
flag inwrite_function
.Resolves #47