Skip to content

add poisson solver to generate electrical field from non neutral charged gas densities - #5730

Open
Ehtyar wants to merge 7 commits into
ComputationalRadiationPhysics:devfrom
Ehtyar:topic-poisson
Open

Ehtyar wants to merge 7 commits into
ComputationalRadiationPhysics:devfrom
Ehtyar:topic-poisson

Conversation

@Ehtyar

@Ehtyar Ehtyar commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Provide poisson solver
This is a continuation of PR #5366.

The poison solver is only solving the E-Field for the initial gas density not for densities created during the slide!

Use picongpu --help to see how to enable the poison solver

Poisson solver:
  --poisson.activate                    enable poisson solver
  --poisson.maxSteps arg (=2000)        maximum number of steps for the 
                                        preconditioner
  --poisson.epsilon arg (=1e-08)        maximal allowed error of the poisson 
                                        solver
  --poisson.preconditioner.disable      disable poisson solver preconditioner
  --poisson.preconditioner.maxSteps arg (=20)
                                        maximum number of steps for the 
                                        preconditioner

output during execution

...
PIConGPUVerbose PHYSICS(1) | Poisson solver:
PIConGPUVerbose PHYSICS(1) |   - converged after 74/100 iterations with norm=509.216, total epsilon=5.15989e-09
PIConGPUVerbose PHYSICS(1) |   - duration 3.5903 sec
...

Requires PR #5729

@psychocoderHPC

psychocoderHPC commented Jul 9, 2026

Copy link
Copy Markdown
Member

Thanks for taking over!

Please reverence the original PR in the first comment this PR is replacing.
The original PR has a list of points we need to do, one nessesare is to extent the documentation for the command line paranater (rst file). It mostly mean copiing the docs from TBG_macros over to the rst file.

@psychocoderHPC

Copy link
Copy Markdown
Member

As mentioned in #5366 we need to move forEachCell into PMacc first. One of the reasons is that we have two different licenses, one for PMacc and one for PIConGPU, if the code is going mainline we should have yhe correct license in.

@Ehtyar

Ehtyar commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

The original PR has a list of points we need to do, one nessesare is to extent the documentation for the command line paranater (rst file). It mostly mean copiing the docs from TBG_macros over to the rst file.

At least the TBG documentation rst file automatically includes the TBG_macros. Is there a separate rst file, that this should be referenced in?
The other points in the original PR I am still working on.

As mentioned in #5366 we need to move forEachCell into PMacc first. One of the reasons is that we have two different licenses, one for PMacc and one for PIConGPU, if the code is going mainline we should have yhe correct license in.

I can do that. Where in PMacc should it go? Do I need to do something more specific than moving the definition and make sure everything is properly included as neccessary?

Comment thread share/picongpu/tests/PoissonSolver/lib/python/test/validate_results.py Outdated
Comment thread share/picongpu/tests/PoissonSolver/bin/ci.sh
Comment thread include/picongpu/simulation/stage/Poisson.x.cpp Outdated
@Ehtyar

Ehtyar commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

@psychocoderHPC @steindev Please have a look, when you are back.
I don't know, why it fails the ci tests but it should work otherwise.

After looking in the ci logs, apparently it works on some configurations but fails in others.

@Ehtyar

Ehtyar commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Since I don't know a better way to run these tests, I will push a couple of times. Please excuse this.

@Ehtyar
Ehtyar force-pushed the topic-poisson branch 7 times, most recently from c93f9c8 to d950c95 Compare July 30, 2026 14:15
@Ehtyar

Ehtyar commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@chillenzer Please have a look at the pypicongpu and picmi changes.

@psychocoderHPC psychocoderHPC added this to the 0.9.0 / next stable milestone Aug 19, 2026
@psychocoderHPC psychocoderHPC added the component: core in PIConGPU (core application) label Aug 19, 2026
psychocoderHPC
psychocoderHPC previously approved these changes Aug 19, 2026

@psychocoderHPC psychocoderHPC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to wait for @chillenzer green 👍

Comment thread include/picongpu/fields/poissonSolver/BICGStab.hpp Outdated
Comment thread include/picongpu/fields/poissonSolver/ChargeDeposition.hpp Outdated
Comment thread include/picongpu/fields/poissonSolver/BICGStab.hpp Outdated
Comment thread share/picongpu/tests/PoissonSolver/include/picongpu/param/particle.param Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain the physical setup of the test as well.

@chillenzer chillenzer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only reviewed the Python part for now. Looks plausible, some naming suggestions.

Comment thread lib/python/picongpu/pypicongpu/poissonsolver.py Outdated
Comment thread lib/python/picongpu/pypicongpu/poissonsolver.py Outdated
Comment thread lib/python/picongpu/pypicongpu/poissonsolver.py Outdated
Comment thread include/pmacc/algorithms/ForEachCell.hpp Outdated
Ehtyar and others added 6 commits September 9, 2026 09:51
…ged gas densities

With this commit PIConGPU provides a poisson solver to generate the electric field during the starting conditions.
It can be activated by providing the `--poisson.activate` flag when starting a picongpu simulation. See TBG docu and `picongpu --help` for more options.

A test for the Poisson solver is also provided.

Co-authored-by: René Widera <r.widera@hzdr.de>
Co-authered-by: Luca <pennati@kth.se>
    There is now a way to use it in both frameworks. It probably needs some more documentation though.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: core in PIConGPU (core application)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants