spectralDNS / shenfun

High performance computational platform in Python for the spectral Galerkin method

Home Page:http://shenfun.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue on Stokes equations with doubly periodic boundary conditions.

zhugp123 opened this issue · comments

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?

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.

Dear Prof. Mikael Mortensen,

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