Skip to content

Commit

Permalink
Added ref_particle charge & mass as user options in dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
proy30 committed Sep 28, 2024
1 parent 2751795 commit fe67b7d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def run_simulation():
# reference particle
pc = sim.particle_container()
ref = pc.ref_particle()
ref.set_charge_qe(-1.0).set_mass_MeV(0.510998950).set_kin_energy_MeV(kin_energy_MeV)
ref.set_charge_qe(state.charge_qe).set_mass_MeV(state.mass_MeV).set_kin_energy_MeV(
kin_energy_MeV
)

distribution = distribution_parameters()
sim.add_particles(bunch_charge_C, distribution, npart)
Expand Down
22 changes: 21 additions & 1 deletion src/python/impactx/dashboard/Input/inputParameters/inputMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def __init__(self):
state.bunch_charge_C = 1.0e-9
state.kin_energy_unit = "MeV"
state.old_kin_energy_unit = "MeV"
state.charge_qe = -1.0
state.mass_MeV = 0.510998950

state.npart_validation = []
state.kin_energy_validation = []
Expand All @@ -80,7 +82,7 @@ def card(self):
Creates UI content for beam properties.
"""

with vuetify.VCard(style="width: 340px; height: 300px"):
with vuetify.VCard(style="width: 340px; height: 350px"):
with vuetify.VCardTitle("Input Parameters"):
vuetify.VSpacer()
vuetify.VIcon(
Expand All @@ -96,6 +98,24 @@ def card(self):
items=([1, 2, 3],),
dense=True,
)

with vuetify.VRow(classes="my-2"):
with vuetify.VCol(cols=6, classes="py-0"):
vuetify.VTextField(
label="Ref. Particle Charge",
v_model=("charge_qe",),
suffix="qe",
type="number",
dense=True,
)
with vuetify.VCol(cols=6, classes="py-0"):
vuetify.VTextField(
label="Ref. Particle Mass",
v_model=("mass_MeV",),
suffix="MeV",
type="number",
dense=True,
)
with vuetify.VRow(classes="my-0"):
with vuetify.VCol(cols=12, classes="py-0"):
vuetify.VTextField(
Expand Down

0 comments on commit fe67b7d

Please sign in to comment.