Skip to content

Commit

Permalink
Add special mode on Hyper-Diffusion
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceyron committed May 14, 2024
1 parent 82dce51 commit af2d422
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions special_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
"Unbalanced Advection",
"Anisotropic Diffusion",
"Dispersion",
"Hyper-Diffusions",
"Korteweg-de Vries",
"Hyper-Diffusion",
# "Korteweg-de Vries",
],
)

Expand Down Expand Up @@ -266,6 +266,23 @@

advect_over_diffuse = st.toggle("Advect over diffuse", value=False)

elif dynamic_type == "Hyper-Diffusion":
hyper_diffusivity_cols = st.columns(3)
with hyper_diffusivity_cols[0]:
hyper_diffusivity_mantissa = st.slider(
"hyper_diffusivity mantissa", 0.0, 1.0, 0.1
)
with hyper_diffusivity_cols[1]:
hyper_diffusivity_exponent = st.slider(
"hyper_diffusivity exponent", -5, 5, 0
)
hyper_diffusivity_sign = "+"
hyper_diffusivity = float(
f"{hyper_diffusivity_sign}{hyper_diffusivity_mantissa}e{hyper_diffusivity_exponent}"
)

diffuse_over_diffuse = st.toggle("Diffuse over diffuse", value=False)


if dynamic_type == "Unbalanced Advection":
stepper = ex.stepper.Advection(
Expand All @@ -292,6 +309,15 @@
dispersivity=dispersivity,
advect_on_diffusion=advect_over_diffuse,
)
elif dynamic_type == "Hyper-Diffusion":
stepper = ex.stepper.HyperDiffusion(
num_spatial_dims,
domain_extent,
num_points,
dt,
hyper_diffusivity=hyper_diffusivity,
diffuse_on_diffuse=diffuse_over_diffuse,
)


if num_spatial_dims == 1:
Expand Down

0 comments on commit af2d422

Please sign in to comment.