inducer / arraycontext

Choose your favorite numpy-workalike!
6 stars 11 forks source link

Improve freeze/thaw usability #22

Closed inducer closed 3 years ago

inducer commented 3 years ago

In addition to a better explanation of freeze and thaw, this PR makes it possible to fail noisily in situations like https://github.com/inducer/grudge/pull/121#discussion_r648598039. Specifically, the new ArrayContext.clone() method allows making the "setup" array context of the discretization semantically distinct from the array context used in user code, which allows these mistakes to be caught.

This PR comes with additional small changes in meshmode and grudge that make use of these features:

@thomasgibson Could you take a look, specifically at the explanation that I've added?

Closes #19. Closes #21.

inducer commented 3 years ago

@anderson2981 @mtcam I recall that both of you also had gripes about the freeze/thaw interface. Please take a look here and see if this helps make this a bit clearer.

inducer commented 3 years ago

I'm starting to like this more and more. It found a few bugs in meshmode, for instance:

inducer commented 3 years ago

@alexfikl Thanks for taking a look!