Closed benegee closed 4 months ago
We are using
p4est
in our flow solverTrixi.jl
via the Julia APIP4est.jl
.
This is really cool stuff!
To construct new p4ests, we use
p4est_new_ext
and setdata_size
to2 * sizeof(Int)
. This data is used internally during computation of error indicators for adaptive mesh refinement. I now want to use Trixi's restart feature. In this case we usep4est_load_ext
to load an existing p4est from a file. As far as I understand, settingdata_size
is not enough here and I would also have to setload_data
to load some actual data. Indeed, this data is irrelevant for Trixi in between mesh refinement step, so it is not saved to files. What I would like to do is to load a p4est from file, not load any user data, but still allocate memory for user data for the subsequent mesh refinement steps. Is this somehow possible?
Indeed, the load function is a bit inflexible in this regard. You may set load_data to 0 and subsequently call p4est_reset_data with the desired size. See the documentation (generated by make doxygen) for further parameters.
Thanks a lot @cburstedde! That is exactly what we need!
And it works!
And it works!
Nice! :)
We are using
p4est
in our flow solverTrixi.jl
via the Julia APIP4est.jl
.To construct new p4ests, we use
p4est_new_ext
and setdata_size
to2 * sizeof(Int)
. This data is used internally during computation of error indicators for adaptive mesh refinement. I now want to use Trixi's restart feature. In this case we usep4est_load_ext
to load an existing p4est from a file. As far as I understand, settingdata_size
is not enough here and I would also have to setload_data
to load some actual data. Indeed, this data is irrelevant for Trixi in between mesh refinement step, so it is not saved to files. What I would like to do is to load a p4est from file, not load any user data, but still allocate memory for user data for the subsequent mesh refinement steps. Is this somehow possible?@sloede @jmark