-
Notifications
You must be signed in to change notification settings - Fork 89
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
Make DenseArray
and SparseArray
immutable
#1214
Comments
Have you considered fracture propagation? |
@IvarStefansson no, we need to discuss this |
Fair point. I think it is implicit that if the geometry is updated, more or less all parameters and discretizations must be updated. However, now is maybe a good time to make such assumptions explicit, or find out how to avoid making them. |
@jwboth the current hashing implementation silently assumes that the values of DenseArrays and SparseArrays are not touched by a user after the ad tree is once built. If someone modifies them, which is unlikely, because they are meant to be constant in contrary to TimeDependentDenseArrays, cashing will produce invalid result and no error will be thrown. |
During the discussion with @keileg, the idea was considered to make the array and matrix AD operators immutable. Effectively, this can be achieved by setting the certain flag for the underlying numpy arrays, see this. Right now, these objects are not meant to be modified, however, there is no strict rule about it. The changeable during the simulation quantities are supported with
TimeDependentDenseArray
.The motivation of the change is that the immutability will be assumed and utilized for hashing #1179, and this will be a safeguard against violating this assumption.
The text was updated successfully, but these errors were encountered: