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

[WIP] Collective Effects Config in Dashboard #690

Draft
wants to merge 37 commits into
base: development
Choose a base branch
from

Conversation

proy30
Copy link
Contributor

@proy30 proy30 commented Aug 29, 2024

PR adds in Space Charge and CSR configuration for users.

For Space Charge:

  • Defaults
    • poisson_solver = "fft" (though, in ImpactX documentation default is "multigrid".)
    • max_level = 1
    • particle_shape = 2
    • n_cell = 1 (for x, y, z)
  • Validation
    • n_cell - Must be an integer and >=1
    • prob_relative - If poisson_solver = "fft", then first val. in array must be >=3, else if poisson_solver = "multigrid", then first val. in array must be >1. rest of values in array must >1.

For CSR

  • Defaults
    • csr_bins = 150
  • Validation
    • csr_bins = must be an int

Resolves #665

@proy30 proy30 added component: dashboard our browser based trame dashboard component: space charge Space charge & potential solver labels Aug 29, 2024
@proy30 proy30 marked this pull request as draft August 29, 2024 02:24
@proy30 proy30 self-assigned this Aug 29, 2024
@ax3l ax3l self-requested a review August 29, 2024 05:46
@proy30
Copy link
Contributor Author

proy30 commented Sep 5, 2024

UI as of 9/4/24 - 6:25pm PST:

chrome_dDj4cC6PK7

src/python/impactx/dashboard/Input/generalFunctions.py Outdated Show resolved Hide resolved
Comment on lines +21 to +26
try:
prob_relative_value = float(prob_relative_value)
poisson_solver = state.poisson_solver

if poisson_solver == "multigrid":
Copy link
Member

Choose a reason for hiding this comment

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

Validation looks good.


state.dynamic_size = False
state.max_level = 3
state.n_cell = [0.0, 0.0, 0.0]
Copy link
Member

Choose a reason for hiding this comment

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

n_cell are integers.

Validation: they MUST be >1 if space charge (any solver) is on.

A sensible, coarse default is:

Suggested change
state.n_cell = [0.0, 0.0, 0.0]
state.n_cell = [32, 32, 32]

@ax3l ax3l changed the title [WIP] Space Charge Configuration [WIP] Collective Effects Config in Dashboard Sep 5, 2024
@ax3l ax3l added the component: CSR coherent synchrotron radiation models label Sep 5, 2024
@proy30
Copy link
Contributor Author

proy30 commented Sep 5, 2024

Accidently pulled in code from unit testing.. need to remove first 18 commits as they are not related to this PR.

@proy30 proy30 force-pushed the dashboard/space_charge_configuration branch from d6d3cb1 to c08a1be Compare September 6, 2024 17:19
Comment on lines +44 to +57
if state.space_charge:
sim.max_level = state.max_level
sim.n_cell = state.n_cell
sim.particle_shape = state.particle_shape
sim.poisson_solver = state.poisson_solver
sim.space_charge = state.space_charge
sim.dynamic_size = state.dynamic_size
sim.prob_relative = state.prob_relative

# csr
if state.csr:
sim.csr = state.csr
sim.csr_bins = state.csr_bins

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, particle_shape is only displayed when space_charge is set to True. However, I see that particle_shape is also being used in run_chicane_csr.py. Should we consider having particle_shape displayed for CSR as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: CSR coherent synchrotron radiation models component: dashboard our browser based trame dashboard component: space charge Space charge & potential solver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard] Missing Space Charge Configuration
2 participants