Add support for number-density deposition by ionization level#1354
Merged
Conversation
| auto [shape_y, j] = shape_factor<depos_order>(ymid, iy); | ||
|
|
||
| const amrex::Real charge_density = q_invvol * shape_x * shape_y; | ||
| const amrex::Real num_density = invvol * shape_x * shape_y * ptd.rdata(PlasmaIdx::w)[ip]; |
Member
There was a problem hiding this comment.
Can you add const amrex::Real w = ptd.rdata(PlasmaIdx::w)[ip] at the top after vy = ... so we don't have to access the value multiple times.
| const bool deposit_jx_jy, const bool deposit_jz, const bool deposit_rho, | ||
| const bool deposit_chi, const bool deposit_rhomjz, | ||
| amrex::Vector<amrex::Geometry> const& gm, int const lev) | ||
| const bool deposit_chi, const bool deposit_rhomjz,const bool deposit_n, |
Member
There was a problem hiding this comment.
Suggested change
| const bool deposit_chi, const bool deposit_rhomjz,const bool deposit_n, | |
| const bool deposit_chi, const bool deposit_rhomjz, const bool deposit_n, |
| m_multi_plasma.DepositCurrent(m_fields, WhichSlice::This, true, false, | ||
| m_deposit_rho || m_deposit_rho_individual, true, true, m_3D_geom, lev); | ||
| m_deposit_rho || m_deposit_rho_individual, | ||
| true, true, m_deposit_n ||m_deposit_n_ion_levels,m_3D_geom, lev); |
Member
There was a problem hiding this comment.
Suggested change
| true, true, m_deposit_n ||m_deposit_n_ion_levels,m_3D_geom, lev); | |
| true, true, m_deposit_n || m_deposit_n_ion_levels, m_3D_geom, lev); |
Same thing in the call to DepositCurrent below
Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com>
Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com>
Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com>
Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com>
Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com>
Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com>
Member
|
Thanks for the review @AlexanderSinn. @huixingjian is this ready for another review? |
Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com>
Contributor
Author
Yep, it's ready now. the issues that @AlexanderSinn mentioned are all resolved |
MaxThevenet
reviewed
Apr 10, 2026
Member
MaxThevenet
left a comment
There was a problem hiding this comment.
Looks good, thanks for this PR! As discussed offline, would be good to add CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the option
hipace.deposit_nto deposit the number density into the fieldn_<plasma_name>. Ifhipace.deposit_n_ion_levels = 1is enabled, the number density is also deposited separately for each ionization level of every plasma species into fields of the formn_<plasma_name>_ionlev_N.Test:
when ``hipace.deposit_n=1`, number density is deposited. Here seeing the plot with clear guiding channel and plasma blowout
With `hipace.deposit_n_ion_levels=1``, test with argon