-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test for EH. doesnt work with ee yet though. hmm
- Loading branch information
Showing
3 changed files
with
109 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
units: | ||
laser wavelength: 351nm | ||
reference electron temperature: 300eV | ||
reference ion temperature: 300eV | ||
reference electron density: 1.5e21/cm^3 | ||
Z: 30 | ||
Ion: Au+ | ||
logLambda: nrl | ||
|
||
|
||
density: | ||
quasineutrality: true | ||
species-background: | ||
noise_seed: 420 | ||
noise_type: gaussian | ||
noise_val: 0.0 | ||
v0: 0.0 | ||
T0: 1.0 | ||
m: 2.0 | ||
n: | ||
basis: uniform | ||
baseline: 1.0 | ||
bump_or_trough: bump | ||
center: 0.0 | ||
rise: 25.0 | ||
bump_height: 0.0 | ||
width: 100000.0 | ||
T: | ||
basis: sine | ||
baseline: 1.0 | ||
amplitude: 1.0e-3 | ||
wavelength: 50000.0 | ||
|
||
grid: | ||
dt: 25.0 | ||
nv: 256 | ||
nx: 32 | ||
tmin: 0. | ||
tmax: 50000.0 | ||
vmax: 8.0 | ||
xmax: 100000.0 | ||
xmin: 0.0 | ||
nl: 1 | ||
|
||
save: | ||
fields: | ||
t: | ||
tmin: 0.0 | ||
tmax: 50000.0 | ||
nt: 11 | ||
electron: | ||
t: | ||
tmin: 0.0 | ||
tmax: 50000.0 | ||
nt: 6 | ||
|
||
mode: vfp-2d | ||
|
||
mlflow: | ||
experiment: vfp2d | ||
run: epperlein-short | ||
|
||
drivers: | ||
ex: {} | ||
ey: {} | ||
|
||
terms: | ||
fokker_planck: | ||
flm: | ||
ee: false | ||
f00: | ||
type: Dougherty | ||
e_solver: oshun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import os, yaml, mlflow, numpy as np | ||
|
||
from utils.runner import run | ||
|
||
|
||
def _run_(Z): | ||
# with open("configs/tf-1d/damping.yaml", "r") as fi: | ||
with open(f"{os.path.join(os.getcwd(), 'tests/test_vfp1d/epp-short')}.yaml", "r") as fi: | ||
cfg = yaml.safe_load(fi) | ||
|
||
cfg["units"]["Z"] = Z | ||
mlflow.set_experiment(cfg["mlflow"]["experiment"]) | ||
# modify config | ||
with mlflow.start_run(run_name=cfg["mlflow"]["run"]) as mlflow_run: | ||
result, datasets = run(cfg) | ||
|
||
kappa_eh = mlflow.get_run(mlflow_run.info.run_id).data.metrics["kappa_eh"] | ||
kappa = mlflow.get_run(mlflow_run.info.run_id).data.metrics["kappa"] | ||
return kappa, kappa_eh | ||
|
||
|
||
def test_kappa_eh(): | ||
actual = [] | ||
desired = [] | ||
for Z in list(range(1, 21, 4)) + [40, 60, 80]: | ||
kappa, kappa_eh = _run_(Z) | ||
actual.append(kappa) | ||
desired.append(kappa_eh) | ||
|
||
np.testing.assert_allclose(actual, desired, rtol=0.2) |