Skip to content

Commit

Permalink
ui-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LemurPwned committed Dec 20, 2024
1 parent 638bd57 commit a685105
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
6 changes: 5 additions & 1 deletion view/simulation_fns.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ def create_single_domain(id_: str) -> Layer:

def create_single_layer(id_: str) -> tuple:
"""Do not forget to rescale the units!"""
demag = [CVector(0, 0, 0), CVector(0, 0, 0), CVector(0, 0, 1)]
demag = [
CVector(st.session_state[f"Nxx{id_}"] * 1e-6, 0, 0),
CVector(0, st.session_state[f"Nyy{id_}"] * 1e-6, 0),
CVector(0, 0, st.session_state[f"Nzz{id_}"] * 1e-6),
]
Kdir = FieldScan.angle2vector(
theta=st.session_state[f"theta_K{id_}"], phi=st.session_state[f"phi_K{id_}"]
)
Expand Down
25 changes: 22 additions & 3 deletions view/streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,25 @@ def import_session_state(file):
key=f"phi_K{i}",
help="Azimuthal angle of the anisotropy axis",
)
st.write("Demagnetization field")
st.number_input(
f"Nxx ({i+1})",
value=0.0,
key=f"Nxx{i}",
format="%0.5f",
)
st.number_input(
f"Nyy ({i+1})",
value=0.0,
key=f"Nyy{i}",
format="%0.5f",
)
st.number_input(
f"Nzz ({i+1})",
value=1.0,
key=f"Nzz{i}",
format="%0.5f",
)
st.markdown("-----\n")

with st.expander("Interlayer parameters"):
Expand Down Expand Up @@ -310,9 +329,9 @@ def import_session_state(file):
st.button("Simulate PIMM", on_click=simulate_pimm, key="PIMM_btn")
st.number_input(
"Hoe (kA/m)",
min_value=0.05,
max_value=50.0,
value=0.05,
min_value=-500.0,
max_value=500.0,
value=50.0,
key="Hoe_mag",
help="Magnitude of the Oersted field impulse (PIMM excitation)",
)
Expand Down

0 comments on commit a685105

Please sign in to comment.