PyMPDATA_examples.Molenkamp_test_as_in_Jaruga_et_al_2015_Fig_12.analysis

 1from joblib import Parallel, delayed
 2from PyMPDATA_examples.Molenkamp_test_as_in_Jaruga_et_al_2015_Fig_12.settings import (
 3    Settings,
 4)
 5from PyMPDATA_examples.Molenkamp_test_as_in_Jaruga_et_al_2015_Fig_12.simulation import (
 6    Simulation,
 7)
 8
 9from PyMPDATA import Options
10
11options = {
12    "upwind": Options(n_iters=1),
13    "2+fct": Options(n_iters=2, nonoscillatory=True),
14    "3+fct+tot": Options(n_iters=3, nonoscillatory=True, third_order_terms=True),
15    "2+fct+iga": Options(n_iters=2, nonoscillatory=True, infinite_gauge=True),
16}
17
18
19def compute_panel(panel):
20    settings = Settings(n_rotations=6)
21    simulation = Simulation(settings, options[panel])
22    if panel == "upwind":
23        return simulation.state
24    simulation.run()
25    return simulation.state
26
27
28def fig_12_data():
29    data = Parallel(n_jobs=-2)(
30        delayed(compute_panel)(panel)
31        for panel in ["upwind", "2+fct", "3+fct+tot", "2+fct+iga"]
32    )
33    return data
options = {'upwind': <PyMPDATA.options.Options object>, '2+fct': <PyMPDATA.options.Options object>, '3+fct+tot': <PyMPDATA.options.Options object>, '2+fct+iga': <PyMPDATA.options.Options object>}
def compute_panel(panel):
20def compute_panel(panel):
21    settings = Settings(n_rotations=6)
22    simulation = Simulation(settings, options[panel])
23    if panel == "upwind":
24        return simulation.state
25    simulation.run()
26    return simulation.state
def fig_12_data():
29def fig_12_data():
30    data = Parallel(n_jobs=-2)(
31        delayed(compute_panel)(panel)
32        for panel in ["upwind", "2+fct", "3+fct+tot", "2+fct+iga"]
33    )
34    return data