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

Collective Effects Config in Dashboard #690

Draft
wants to merge 56 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.

TODO:

  • Space Charge Defaults
    • poisson_solver = "fft" (though, in ImpactX documentation default is "multigrid".)
    • max_level = 0
    • particle_shape = 2
    • n_cell = 1 (for x,y,z)
    • blocking_factor (x,y,z) - 32
  • Space Charge Validation
    • n_cell - value_type = 'int' & >=1, must be a factor of blocking_factor
    • prob_relative - if poisson_solver = "fft", index[0] >=3
      if possion_solver = "multigrid", index[0] >1
      else index[1-(n-1)] >1
    • blocking_factor (x,y,z) - Greater than 0
  • CSR Defaults
    • csr_bins = 150
  • CSR Validation
    • csr_bins='int', positive number
  • Add multigrid-specific numerical options (no validation as of now)
    • MLMG Relative Tolerance
    • MLMG Absolute Tolerance
    • MLMG Max Iterations
    • MLMG Verbosity
  • Update export_template
  • Update run_simulation status function

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

@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 proy30 force-pushed the dashboard/space_charge_configuration branch from d6d3cb1 to c08a1be Compare September 6, 2024 17:19
@proy30 proy30 force-pushed the dashboard/space_charge_configuration branch from 2ddadf9 to 774b365 Compare October 24, 2024 15:41
@proy30 proy30 changed the title [WIP] Collective Effects Config in Dashboard Collective Effects Config in Dashboard Nov 7, 2024
Comment on lines +55 to +57
sim.blocking_factor_x = [state.blocking_factor_x]
sim.blocking_factor_y = [state.blocking_factor_y]
sim.blocking_factor_z = [state.blocking_factor_z]
Copy link
Member

Choose a reason for hiding this comment

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

I can't remember how this works on the AMReX end, so just to double check, do these have to be single-element lists or can they be simply integers?

Copy link
Member

@cemitch99 cemitch99 Nov 8, 2024

Choose a reason for hiding this comment

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

Looking at this, it looks like this can be a single integer. Indeed, we use a single integer in this example. Unfortunately the ImpactX documentation does not appear to address the blocking factor, so this needs to be updated.

Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this is a git display issue, but the indentation of the function body for build_space_charge_or_csr seems off. Could you double check?

with vuetify.VCol(cols=6, classes="py-0"):
vuetify.VTextField(
label="MLMG Relative Tolerance",
v_model=("mlmg_relative_tolerance",),
Copy link
Member

Choose a reason for hiding this comment

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

In one discussion in the Trame repo, I was told that one could use v_model_number as well (on top of type="number") and that it could render numbers better when it comes to formatting.

I did try it on my end without noticing any significant improvement, but maybe you could try it as well.

For reference, here's the comment where this was mentioned: Kitware/trame#599 (reply in thread).

Comment on lines +47 to +52
if state.poisson_solver == "fft":
state.prob_relative = [1.1] + [0.0] * (num_prob_relative_fields - 1)
elif state.poisson_solver == "multigrid":
state.prob_relative = [3.1] + [0.0] * (num_prob_relative_fields - 1)
else:
state.prob_relative = [0.0] * num_prob_relative_fields
Copy link
Member

Choose a reason for hiding this comment

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

Question for both you and @cemitch99, should we add a comment about the numbers that appear here (e.g., 1.1, 3.1, etc.)? I'm not too familiar with the context here, so I'm not sure if the meaning of these numbers should be clarified.

Copy link
Member

Choose a reason for hiding this comment

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

Those numbers in prob_relative specify the size of the grid relative to the size of the beam, and are documented here and here. Maybe some of the input parameters should include links to the documentation?

Copy link
Member

@cemitch99 cemitch99 left a comment

Choose a reason for hiding this comment

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

This looks good to me. We can discuss a little when we chat today.

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
4 participants