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

Add quasi-3D Integrated Green Functions solver #5089

Merged
merged 73 commits into from
Dec 17, 2024

Conversation

aeriforme
Copy link
Member

@aeriforme aeriforme commented Jul 27, 2024

This PR implements a quasi-3D Poisson solver based on the Integrated Green's functions.
It solves the 2D Poisson equation on the (x,y) plane for every slice z.
It is useful for beam-beam simulations.

See PR #4648 for the full 3D solver.

🔪 🐟

@aeriforme aeriforme added component: spectral Spectral solvers (PSATD, IGF) component: electrostatic electrostatic solver labels Jul 27, 2024
@aeriforme aeriforme requested a review from RemiLehe July 27, 2024 00:19
@ax3l ax3l self-requested a review August 13, 2024 18:43
@aeriforme aeriforme changed the title [WIP] Add quasi-3D Integrated Green Functions solver Add quasi-3D Integrated Green Functions solver Sep 19, 2024
@aeriforme aeriforme changed the title Add quasi-3D Integrated Green Functions solver [WIP] Add quasi-3D Integrated Green Functions solver Sep 19, 2024
@aeriforme aeriforme changed the title [WIP] Add quasi-3D Integrated Green Functions solver Add quasi-3D Integrated Green Functions solver Dec 6, 2024
@aeriforme aeriforme requested a review from RemiLehe December 6, 2024 17:33
Copy link
Member

@RemiLehe RemiLehe left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! I left a few comments.

@@ -290,6 +290,19 @@ Overall simulation parameters
In electromagnetic mode, this solver can be used to initialize the species' self fields
(``<species_name>.initialize_self_fields=1``) provided that the field BCs are PML (``boundary.field_lo,hi = PML``).

* warpx.use_2d_slices_fft_solver (`bool`, default: 0): Select the type of Integrated Green Function solver.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* warpx.use_2d_slices_fft_solver (`bool`, default: 0): Select the type of Integrated Green Function solver.
* ``warpx.use_2d_slices_fft_solver`` (`bool`, default: 0): Select the type of Integrated Green Function solver.

@@ -0,0 +1,20 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

Could you remove this .json file? It seems that it is no longer needed/used.

Comment on lines 301 to 304
* warpx.use_distributed_3d_fft_solver (`bool`, default: 0): Choose whether the 3D FFTs performed in the
full 3D Integrated Green Function solver are distributed.
If 0, the FFTs are performed on a single MPI rank (the rest of the code is still fully parallel).
If 1, the FFTs are distributed using the heFFTe library. The code must be compiled with `-DWarpX_HEFFTE=ON`.
Copy link
Member

Choose a reason for hiding this comment

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

Could you remove this? It seems that it is not actually used in the code.

}


/** @brief Implements minus equation 58 in https://doi.org/10.1016/j.jcp.2004.01.008
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/** @brief Implements minus equation 58 in https://doi.org/10.1016/j.jcp.2004.01.008
/** @brief Implements equation 58 in https://doi.org/10.1016/j.jcp.2004.01.008

I think I understand what is meant here, but the term "minus equation" might be confusing. I think it is fine to simply say "equation 58".

@@ -90,7 +129,8 @@ namespace ablastr::fields
computePhiIGF (amrex::MultiFab const & rho,
amrex::MultiFab & phi,
std::array<amrex::Real, 3> const & cell_size,
amrex::BoxArray const & ba);
amrex::BoxArray const & ba,
bool do_2d_slices);
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to use the same name (is_igf_2d_slices) as in the other functions - instead of do_2d_slices?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, sure!

@RemiLehe RemiLehe enabled auto-merge (squash) December 17, 2024 00:13
@RemiLehe RemiLehe merged commit 2a4cde2 into ECP-WarpX:development Dec 17, 2024
37 checks passed
@@ -71,7 +69,9 @@ computePhiIGF ( amrex::MultiFab const & rho,
amrex::Real const dy = cell_size[1];
amrex::Real const dz = cell_size[2];

obc_solver->setGreensFunction(
if (!is_igf_2d_slices){
// 2D sliced solver
Copy link
Member

Choose a reason for hiding this comment

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

This comment here and the one in the else part are incorrect.

Copy link
Member Author

Choose a reason for hiding this comment

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

oops! I will fix it

RemiLehe pushed a commit that referenced this pull request Dec 18, 2024
This is a minor follow-up to PR #5089.
It fixes two comments and adds the documentation entry about
`ablastr.nprocs_igf_fft`.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: electrostatic electrostatic solver component: spectral Spectral solvers (PSATD, IGF)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants