Is it safe to save copies of boxarray/distromap in fortran make_level_from_scratch "virtual" functions #4583
-
We're using the Fortran interface with registered "virtual" functions via ...
type(amrex_boxarray), intent(in) :: ba
type(amrex_distromap), intent(in) :: dm
...
!! Set the mesh data for this level
this%ba(level) = ba
this%dm(level) = dm The initialization runs successfully and creates the expected number of levels (6 in our test case). However, we get a segfault when using these saved Are we not allowed to save instances of the boxarray and distromap that are passed into the amr callbacks? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Right, it is not safe to use BoxArray and DistributionMapping saved like that. The technical detail is that the DistributionMapping passed to the Fortran function is a local variable in C++. It's gone after the call. There are three ways if you want to save BoxArray and DistributionMapping.
|
Beta Was this translation helpful? Give feedback.
Right, it is not safe to use BoxArray and DistributionMapping saved like that. The technical detail is that the DistributionMapping passed to the Fortran function is a local variable in C++. It's gone after the call. There are three ways if you want to save BoxArray and DistributionMapping.