inducer / meshmode

High-order unstructured mesh representation and discrete function spaces
https://documen.tician.de/meshmode/
25 stars 24 forks source link

Error when dumping/loading TensorProductElementGroup mesh via pickle #391

Closed a-alveyblanc closed 8 months ago

a-alveyblanc commented 8 months ago

To reproduce: https://gist.github.com/a-alveyblanc/2fa39728dc34e5a12e47592b5ca46eae

Error thrown is: TypeError: Hypercube.__new__() missing 1 required positional argument: 'dim'

alexfikl commented 8 months ago

That's probably due to the fact that Hypercube overwrites __new__ to return a tensor product or a simplex. You'll probably need to implement __getnewargs__ or something to make it pickable.

https://github.com/inducer/modepy/blob/9f5eb94b7723d9b1e1066e0f661739f7a5b99d26/modepy/shapes.py#L447