nbia-astro / skeletor

Parallel PIC code written in Python and based on the skeleton codes provided by PICKSC
GNU General Public License v3.0
1 stars 0 forks source link

PPIC2's Poisson solver is broken #134

Closed tobson closed 7 years ago

tobson commented 7 years ago

None of the electrostatic tests seem to work if one changes

from skeletor.manifolds.mpifft4py import Manifold

to

from skeletor.manifolds.ppic2 import Manifold

Here's a picture from tests/test_plasmafrequency.py:

screen shot 2017-03-18 at 4 36 32 pm
tberlok commented 7 years ago

I actually thought we had discontinued compatibility with ppic2 on purpose. I at least did not expect it to work for the new grid layout without making changes to ppic2_wrapper. Did you make such changes?

tberlok commented 7 years ago

Just checked and we have hardcoded boundaries in the ppic2 manifold. So there is a good reason it does not work. I also did not add dx and dy to that manifold.

tobson commented 7 years ago

I did, yes. And I was actually a little surprised that I got the PPIC2 manifold working with the new grid layout so effortlessly. But now I know that's because there's no test anymore that checks the PPIC2 manifold.

tobson commented 7 years ago

Hardcoded boundaries in the PPIC2 manifold is fine. We only need to copy the active cells to and from the fields that PPIC2's Poisson solver is working with.

tobson commented 7 years ago

Anyway, let's make sure PPIC2's Poisson solver is working. There's no reason it shouldn't.

tobson commented 7 years ago

The suggestion of abandoning the PPIC2 manifold was under the assumption that we'll soon have a finite-difference Poisson solver. But I don't think implementing one is worth the trouble at the moment. Since ρ and E are colocated on the interlaced grid, I suggest we just keep using the FFT-based Poisson solver. We should, however, ditch all other FFT-based differential operators.

tobson commented 7 years ago

Anyway, let's make sure PPIC2's Poisson solver is working. There's no reason it shouldn't.

Well, unless of course they've hardcoded dx=dy=1 into their Poisson solver. But even if they did, I can't imagine that assumption would be difficult to relax.

Anyway, let's discuss this over Skype next week. That'll be much easier. I'll explain why I'd like to keep PPIC2's Poisson solver around.

tobson commented 7 years ago

But even if they did, I can't imagine that assumption would be difficult to relax.

To wit, I'm pretty sure all that needs to be changed in order to allow for arbitrary dx and dy are these two lines.