Skip to content
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

Open
Yuriyzabegaev opened this issue Aug 16, 2024 · 5 comments
Open

Make DenseArray and SparseArray immutable #1214

Yuriyzabegaev opened this issue Aug 16, 2024 · 5 comments

Comments

@Yuriyzabegaev
Copy link
Contributor

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.

@IvarStefansson
Copy link
Contributor

Have you considered fracture propagation?

@Yuriyzabegaev
Copy link
Contributor Author

@IvarStefansson no, we need to discuss this

@keileg
Copy link
Contributor

keileg commented Aug 20, 2024

Have you considered fracture propagation?

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
Copy link
Contributor

jwboth commented Oct 23, 2024

Clarifying question. In the discussion above, the presented issue is described as necessary step for #1179. At the same time #1179 is completed. Is this issue now obsolete, already taken care of, or still an issue?

@Yuriyzabegaev
Copy link
Contributor Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants