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

Issue on Stokes equations with doubly periodic boundary conditions. #101

Open
zhugp123 opened this issue Jan 22, 2024 · 2 comments
Open

Comments

@zhugp123
Copy link

I am trying to solve the 2D Stokes equation with doubly periodic boundary conditions.

For the 0th mode, we need to fix the coefficient \hat{u}{00} = \hat{v}{00} = \hat{p}_{00} = 0. I implement this in Shenfun Solver like this:

up_hat = M.solve(fh_hat, constraints=((0, 0, 0),(1, 0, 0),(2, 0, 0)))

However, the Shenfun Solver gives the following error information:

"File "/home/xx/Mywork/Shenfun/Example/Stokes/TestPeriodic.py", line 41, in
up_hat = M.solve(fh_hat, constraints=((0, 0, 0),(1, 0, 0),(2, 0, 0)))
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices"

I have no idea what's wrong with the constraint. Do you have any suggestions on this issue?

@mikaem
Copy link
Member

mikaem commented Jan 23, 2024

This is a bug and it is due to numpy sum here and here returning a float instead of an int. It is easily fixed and will soon be incorporated.

@zhugp123
Copy link
Author

zhugp123 commented Jan 23, 2024

Dear Prof. Mikael Mortensen,

Thanks for fixing such a bug. Looking forward to the updated Shenfun solver.

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

2 participants