DedalusProject / dedalus

A flexible framework for solving PDEs with modern spectral methods.
http://dedalus-project.org/
GNU General Public License v3.0
489 stars 115 forks source link

np.real operator in equations does not take real part #298

Open lecoanet opened 1 month ago

lecoanet commented 1 month ago

It seems like if you add an equation with an operator "np.real" the code runs without complaining, but it does not appear to take the real part. I will try to come up with a simple example to demonstrate this.

kburns commented 1 month ago

np.real and np.imag are not ufuncs, so I think its treating dedalus fields as just random objects. It looks like we might be able to circumvent this behavior by defining .real and .imag properties that return the operators we want.

kburns commented 1 week ago

Added real and imag properties for operands in #305.