├── .github └── workflows │ └── test_libmpdataxx.yml ├── .travis.yml ├── .travis_scripts ├── UWLCM.sh ├── bconds_div.sh ├── deps_install │ └── install_common.sh ├── elliptic_drop.sh ├── nair_jablonowski_2008.sh ├── paper.sh ├── pbl.sh ├── sandbox.sh ├── setup_local_clang.sh └── unit.sh ├── COPYING ├── CREDITS ├── Dockerfile ├── README.md ├── libmpdata++-config.cmake ├── libmpdata++ ├── CMakeLists.txt ├── bcond │ ├── cyclic_1d.hpp │ ├── cyclic_2d.hpp │ ├── cyclic_3d.hpp │ ├── detail │ │ ├── bcond_common.hpp │ │ ├── polar_common.hpp │ │ ├── remote_3d_common.hpp │ │ └── remote_common.hpp │ ├── gndsky_2d.hpp │ ├── gndsky_3d.hpp │ ├── open_1d.hpp │ ├── open_2d.hpp │ ├── open_3d.hpp │ ├── polar_2d.hpp │ ├── polar_3d.hpp │ ├── remote_1d.hpp │ ├── remote_2d.hpp │ ├── remote_3d.hpp │ ├── rigid_2d.hpp │ ├── rigid_3d.hpp │ └── shared.hpp ├── blitz.hpp ├── concurr │ ├── any.hpp │ ├── boost_thread.hpp │ ├── cxx11_thread.hpp │ ├── detail │ │ ├── concurr_common.hpp │ │ ├── distmem.hpp │ │ ├── sharedmem.hpp │ │ └── timer.hpp │ ├── openmp.hpp │ ├── serial.hpp │ └── threads.hpp ├── formulae │ ├── arakawa_c.hpp │ ├── common.hpp │ ├── domain_decomposition.hpp │ ├── donorcell_formulae.hpp │ ├── idxperm.hpp │ ├── kahan_sum.hpp │ ├── mpdata │ │ ├── formulae_mpdata_1d.hpp │ │ ├── formulae_mpdata_2d.hpp │ │ ├── formulae_mpdata_3d.hpp │ │ ├── formulae_mpdata_common.hpp │ │ ├── formulae_mpdata_dfl_1d.hpp │ │ ├── formulae_mpdata_dfl_2d.hpp │ │ ├── formulae_mpdata_dfl_3d.hpp │ │ ├── formulae_mpdata_fct_1d.hpp │ │ ├── formulae_mpdata_fct_2d.hpp │ │ ├── formulae_mpdata_fct_3d.hpp │ │ ├── formulae_mpdata_fdiv_1d.hpp │ │ ├── formulae_mpdata_fdiv_2d.hpp │ │ ├── formulae_mpdata_fdiv_3d.hpp │ │ ├── formulae_mpdata_g_1d.hpp │ │ ├── formulae_mpdata_g_2d.hpp │ │ ├── formulae_mpdata_g_3d.hpp │ │ ├── formulae_mpdata_gc_1d.hpp │ │ ├── formulae_mpdata_gc_2d.hpp │ │ ├── formulae_mpdata_gc_3d.hpp │ │ ├── formulae_mpdata_hot_1d.hpp │ │ ├── formulae_mpdata_hot_2d.hpp │ │ ├── formulae_mpdata_hot_3d.hpp │ │ ├── formulae_mpdata_psi_1d.hpp │ │ ├── formulae_mpdata_psi_2d.hpp │ │ └── formulae_mpdata_psi_3d.hpp │ ├── nabla_formulae.hpp │ └── stress_formulae.hpp ├── kahan_reduction.hpp ├── opts.hpp ├── output │ ├── detail │ │ ├── output_common.hpp │ │ └── xdmf_writer.hpp │ ├── gnuplot.hpp │ ├── hdf5.hpp │ └── hdf5_xdmf.hpp └── solvers │ ├── boussinesq.hpp │ ├── detail │ ├── boussinesq_common.hpp │ ├── boussinesq_expl.hpp │ ├── boussinesq_impl.hpp │ ├── boussinesq_sgs_common.hpp │ ├── monitor.hpp │ ├── mpdata_common.hpp │ ├── mpdata_fct_1d.hpp │ ├── mpdata_fct_2d.hpp │ ├── mpdata_fct_3d.hpp │ ├── mpdata_fct_common.hpp │ ├── mpdata_osc_1d.hpp │ ├── mpdata_osc_2d.hpp │ ├── mpdata_osc_3d.hpp │ ├── mpdata_rhs_vip_common.hpp │ ├── mpdata_rhs_vip_prs_common.hpp │ ├── mpdata_rhs_vip_prs_gcrk.hpp │ ├── mpdata_rhs_vip_prs_mr.hpp │ ├── mpdata_rhs_vip_prs_pc.hpp │ ├── mpdata_rhs_vip_prs_sgs_common.hpp │ ├── mpdata_rhs_vip_prs_sgs_dns.hpp │ ├── mpdata_rhs_vip_prs_sgs_smg.hpp │ ├── solver_1d.hpp │ ├── solver_2d.hpp │ ├── solver_3d.hpp │ └── solver_common.hpp │ ├── mpdata.hpp │ ├── mpdata_rhs.hpp │ ├── mpdata_rhs_vip.hpp │ ├── mpdata_rhs_vip_prs.hpp │ ├── mpdata_rhs_vip_prs_sgs.hpp │ └── shallow_water.hpp └── tests ├── lauritzen_et_al_2012_GMD ├── CMakeLists.txt ├── gmd_2012.cpp ├── refdata │ ├── stats_nug_i2_120.txt.gz │ ├── stats_nug_i2_240.txt.gz │ ├── stats_nug_iga_fct_i2_120.txt.gz │ └── stats_nug_iga_fct_i2_240.txt.gz └── stats_and_plots.py ├── mp3_paper_2018_JCP ├── CMakeLists.txt ├── README.md ├── manufactured_3d │ ├── CMakeLists.txt │ ├── manufactured_3d.cpp │ ├── refdata │ │ └── manufactured_3d_conv.txt │ └── stats_and_plots.py ├── moving_vort │ ├── CMakeLists.txt │ ├── analytical_formulae.py │ ├── moving_vort.cpp │ ├── moving_vort.hpp │ ├── panel_plot.py │ ├── refdata │ │ ├── moving_vort_conv.txt │ │ └── out_Mp3_192 │ │ │ ├── const.h5 │ │ │ ├── temp.xmf │ │ │ ├── timestep0000000000.h5 │ │ │ ├── timestep0000000000.xmf │ │ │ ├── timestep0000047421.h5 │ │ │ └── timestep0000047421.xmf │ ├── stats_and_plots.py │ ├── test_def.hpp │ └── transforms.hpp ├── python_scripts │ ├── conv_plot.py │ └── helpers.py └── reversing_deform │ ├── CMakeLists.txt │ ├── filaments.py │ ├── mixing.py │ ├── panel_plot.py │ ├── refdata │ ├── common │ │ └── timestep0000000000_240.h5 │ ├── out_Mg2No_240 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000000908.h5 │ │ ├── timestep0000000908.xmf │ │ ├── timestep0000001816.h5 │ │ └── timestep0000001816.xmf │ ├── out_Mg3No_120 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000000454.h5 │ │ ├── timestep0000000454.xmf │ │ ├── timestep0000000908.h5 │ │ └── timestep0000000908.xmf │ ├── out_Mg3No_240 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000000908.h5 │ │ ├── timestep0000000908.xmf │ │ ├── timestep0000001816.h5 │ │ └── timestep0000001816.xmf │ ├── out_Mp3_240 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000000908.h5 │ │ ├── timestep0000000908.xmf │ │ ├── timestep0000001816.h5 │ │ └── timestep0000001816.xmf │ ├── out_Mp3cc_240 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000000908.h5 │ │ ├── timestep0000000908.xmf │ │ ├── timestep0000001816.h5 │ │ └── timestep0000001816.xmf │ ├── reversing_deform_conv.txt │ └── reversing_deform_mixing.txt │ ├── reversing_deform.cpp │ ├── reversing_deform.hpp │ ├── stats_and_plots.py │ └── test_def.hpp ├── nair_jablonowski_2008 ├── CMakeLists.txt ├── common │ └── convergence.hpp ├── moving │ ├── CMakeLists.txt │ ├── moving.cpp │ ├── moving_tot.cpp │ └── refdata │ │ ├── common │ │ └── timestep0000000000.h5 │ │ ├── nug_i2_96 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000006004.h5 │ │ ├── timestep0000006004.xmf │ │ ├── timestep0000012008.h5 │ │ └── timestep0000012008.xmf │ │ ├── nug_iga_fct_i2_96 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000006004.h5 │ │ ├── timestep0000006004.xmf │ │ ├── timestep0000012008.h5 │ │ └── timestep0000012008.xmf │ │ ├── nug_iga_tot_fct_i2_96 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000006004.h5 │ │ ├── timestep0000006004.xmf │ │ ├── timestep0000012008.h5 │ │ └── timestep0000012008.xmf │ │ ├── nug_tot_i3_96 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000006004.h5 │ │ ├── timestep0000006004.xmf │ │ ├── timestep0000012008.h5 │ │ └── timestep0000012008.xmf │ │ ├── stats_nug_i2.txt.gz │ │ ├── stats_nug_iga_fct_i2.txt.gz │ │ ├── stats_nug_iga_tot_fct_i2.txt.gz │ │ └── stats_nug_tot_i3.txt.gz └── stationary │ ├── CMakeLists.txt │ ├── refdata │ ├── common │ │ └── timestep0000000000.h5 │ ├── nug_i2_96 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000001492.h5 │ │ ├── timestep0000001492.xmf │ │ ├── timestep0000002983.h5 │ │ └── timestep0000002983.xmf │ ├── nug_iga_fct_i2_96 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000001492.h5 │ │ ├── timestep0000001492.xmf │ │ ├── timestep0000002983.h5 │ │ └── timestep0000002983.xmf │ ├── nug_iga_tot_fct_i2_96 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000001492.h5 │ │ ├── timestep0000001492.xmf │ │ ├── timestep0000002983.h5 │ │ └── timestep0000002983.xmf │ ├── nug_tot_i3_96 │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000001492.h5 │ │ ├── timestep0000001492.xmf │ │ ├── timestep0000002983.h5 │ │ └── timestep0000002983.xmf │ ├── stats_nug_i2.txt.gz │ ├── stats_nug_iga_fct_i2.txt.gz │ ├── stats_nug_iga_tot_fct_i2.txt.gz │ └── stats_nug_tot_i3.txt.gz │ └── stationary.cpp ├── paper_2015_GMD ├── 0_basic_example │ ├── CMakeLists.txt │ ├── basic_example.cpp │ └── refdata │ │ └── log-orig.gz ├── 1_advscheme_opts │ ├── CMakeLists.txt │ ├── advscheme_opts.cpp │ └── refdata │ │ └── log-orig.gz ├── 2_convergence_1d │ ├── CMakeLists.txt │ ├── convergence_1d.cpp │ ├── plot.py │ └── refdata │ │ ├── err_mpdata_iters=1.txt.gz │ │ ├── err_mpdata_iters=2.txt.gz │ │ ├── err_mpdata_iters=2_fct.txt.gz │ │ ├── err_mpdata_iters=3.txt.gz │ │ ├── err_mpdata_iters=3_tot.txt.gz │ │ ├── err_mpdata_iters=i.txt.gz │ │ ├── err_mpdata_iters=i_fct.txt.gz │ │ └── err_mpdata_iters=i_fct_tot.txt.gz ├── 3_rotating_cone_2d │ ├── CMakeLists.txt │ ├── refdata │ │ ├── log-orig.gz │ │ ├── stats_basic_.txt.gz │ │ ├── stats_fct_.txt.gz │ │ ├── stats_iga_fct_.txt.gz │ │ ├── stats_iga_tot_fct_.txt.gz │ │ └── stats_iters3_tot_fct_.txt.gz │ ├── rotating_cone_2d.cpp │ └── rotating_cone_stats.hpp ├── 4_revolving_sphere_3d │ ├── CMakeLists.txt │ ├── plot.py │ ├── refdata │ │ ├── basic │ │ │ ├── const.h5 │ │ │ ├── temp.xmf │ │ │ ├── timestep0000000000.h5 │ │ │ ├── timestep0000000000.xmf │ │ │ ├── timestep0000000556.h5 │ │ │ └── timestep0000000556.xmf │ │ ├── common │ │ │ └── timestep0000000000.h5 │ │ ├── fct │ │ │ ├── const.h5 │ │ │ ├── temp.xmf │ │ │ ├── timestep0000000000.h5 │ │ │ ├── timestep0000000000.xmf │ │ │ ├── timestep0000000556.h5 │ │ │ └── timestep0000000556.xmf │ │ ├── iga │ │ │ ├── const.h5 │ │ │ ├── temp.xmf │ │ │ ├── timestep0000000000.h5 │ │ │ ├── timestep0000000000.xmf │ │ │ ├── timestep0000000556.h5 │ │ │ └── timestep0000000556.xmf │ │ ├── iga_fct │ │ │ ├── const.h5 │ │ │ ├── temp.xmf │ │ │ ├── timestep0000000000.h5 │ │ │ ├── timestep0000000000.xmf │ │ │ ├── timestep0000000556.h5 │ │ │ └── timestep0000000556.xmf │ │ ├── stats_basic.txt.gz │ │ ├── stats_fct.txt.gz │ │ ├── stats_iga.txt.gz │ │ ├── stats_iga_fct.txt.gz │ │ ├── stats_upwind.txt.gz │ │ └── upwind │ │ │ ├── const.h5 │ │ │ ├── temp.xmf │ │ │ ├── timestep0000000000.h5 │ │ │ ├── timestep0000000000.xmf │ │ │ ├── timestep0000000556.h5 │ │ │ └── timestep0000000556.xmf │ ├── revolving_sphere_3d.cpp │ └── revolving_sphere_stats.hpp ├── 5_over_the_pole_2d │ ├── CMakeLists.txt │ ├── cmap.xml │ ├── over_the_pole_2d.cpp │ ├── over_the_pole_stats.hpp │ ├── plot.py │ └── refdata │ │ ├── best │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000005120.h5 │ │ └── timestep0000005120.xmf │ │ ├── common │ │ └── timestep0000000000.h5 │ │ ├── default │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000005120.h5 │ │ └── timestep0000005120.xmf │ │ ├── stats_best.txt.gz │ │ └── stats_default.txt.gz ├── 6_coupled_harmosc │ ├── CMakeLists.txt │ ├── coupled_harmosc.cpp │ ├── coupled_harmosc.hpp │ ├── coupled_harmosc_stats.hpp │ └── refdata │ │ ├── log-orig.gz │ │ └── stats.txt.gz ├── 7_shallow_water │ ├── CMakeLists.txt │ ├── analytic_eq.py │ ├── errors_1d.py │ ├── errors_2d.py │ ├── plot_1d.py │ ├── plot_2d.py │ ├── plot_2d_3d.py │ ├── plot_settings.py │ ├── refdata │ │ ├── 1d_fct_abs │ │ │ ├── const.h5 │ │ │ ├── timestep0000000000.h5 │ │ │ └── timestep0000000300.h5 │ │ ├── 1d_fct_abs_stats.txt.gz │ │ ├── 1d_fct_iga │ │ │ ├── const.h5 │ │ │ ├── coord.h5 │ │ │ ├── timestep0000000000.h5 │ │ │ └── timestep0000000300.h5 │ │ ├── 1d_fct_iga_stats.txt.gz │ │ ├── 2d_fct_abs │ │ │ ├── const.h5 │ │ │ ├── temp.xmf │ │ │ ├── timestep0000000000.h5 │ │ │ ├── timestep0000000000.xmf │ │ │ ├── timestep0000000300.h5 │ │ │ └── timestep0000000300.xmf │ │ ├── 2d_fct_abs_stats.txt.gz │ │ ├── 2d_fct_iga │ │ │ ├── const.h5 │ │ │ ├── temp.xmf │ │ │ ├── timestep0000000000.h5 │ │ │ ├── timestep0000000000.xmf │ │ │ ├── timestep0000000300.h5 │ │ │ └── timestep0000000300.xmf │ │ ├── 2d_fct_iga_stats.txt.gz │ │ └── common │ │ │ ├── timestep0000000000_1d.h5 │ │ │ └── timestep0000000000_2d.h5 │ ├── shallow_water_1d.cpp │ └── shallow_water_2d.cpp ├── 8_boussinesq_2d │ ├── CMakeLists.txt │ ├── boussinesq_2d.cpp │ ├── boussinesq_stats.hpp │ └── refdata │ │ ├── log-orig.gz │ │ └── stats.txt.gz └── CMakeLists.txt ├── sandbox ├── CMakeLists.txt ├── bconds_div │ ├── CMakeLists.txt │ ├── bconds_div.hpp │ ├── bconds_div_2d.cpp │ └── bconds_div_3d.cpp ├── convergence_2d_3d │ ├── CMakeLists.txt │ ├── convergence_2d.cpp │ └── convergence_3d.cpp ├── convergence_adv_diffusion │ ├── CMakeLists.txt │ ├── convergence_adv_diffusion.cpp │ └── solver.hpp ├── convergence_spacetime │ ├── CMakeLists.txt │ ├── convergence_1d_spacetime.cpp │ ├── convergence_1d_spacetime.hpp │ ├── convergence_2d_spacetime.cpp │ ├── convergence_2d_spacetime.hpp │ ├── convergence_3d_spacetime.cpp │ └── convergence_3d_spacetime.hpp ├── convergence_vip_1d │ ├── CMakeLists.txt │ └── convergence_vip_1d.cpp ├── dcmip │ ├── CMakeLists.txt │ ├── dcmip_1.cpp │ └── dcmip_1.hpp ├── mpi_adv │ ├── CMakeLists.txt │ ├── mpi_adv_2d.cpp │ └── mpi_adv_3d.cpp ├── pbl │ ├── CMakeLists.txt │ ├── budget.py │ ├── pbl.hpp │ ├── pbl_iles.cpp │ ├── pbl_iles_short.cpp │ ├── pbl_smg.cpp │ ├── pbl_smg_short.cpp │ ├── pbl_test_def.hpp │ ├── profiles.py │ └── refdata │ │ ├── budget_pbl_iles_short.h5 │ │ ├── budget_pbl_smg_short.h5 │ │ ├── out_pbl_iles_short │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000000600.h5 │ │ └── timestep0000000600.xmf │ │ ├── out_pbl_smg_short │ │ ├── const.h5 │ │ ├── temp.xmf │ │ ├── timestep0000000000.h5 │ │ ├── timestep0000000000.xmf │ │ ├── timestep0000000600.h5 │ │ └── timestep0000000600.xmf │ │ ├── profiles_pbl_iles_short.txt.gz │ │ └── profiles_pbl_smg_short.txt.gz ├── shear_layer │ ├── CMakeLists.txt │ └── shear_layer.cpp ├── straka │ ├── CMakeLists.txt │ └── straka.cpp └── tgv │ ├── CMakeLists.txt │ ├── tgv_2d.cpp │ └── tgv_3d.cpp └── unit ├── CMakeLists.txt ├── absorber ├── CMakeLists.txt └── absorber.cpp ├── bconds ├── CMakeLists.txt └── bconds.cpp ├── concurrent_1d ├── CMakeLists.txt └── test_concurrent_1d.cpp ├── cone_bugs ├── CMakeLists.txt └── test_issue.cpp ├── delayed_advection ├── CMakeLists.txt └── delayed_advection.cpp ├── git_revision ├── CMakeLists.txt └── test_git_revision.cpp ├── hdf5_catch ├── CMakeLists.txt └── test_hdf5_catch.cpp ├── hint_scale ├── CMakeLists.txt └── hint_scale.cpp ├── kahan_sum ├── CMakeLists.txt └── test_kahan_sum.cpp ├── shallow_water ├── CMakeLists.txt └── test_shallow_water_2d.cpp └── var_dt ├── CMakeLists.txt ├── var_dt_test.cpp └── var_dt_test.hpp /.travis_scripts/UWLCM.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | 4 | if [ $# -ne 1 ]; then 5 | echo "UWLCM.sh accepts exactly one argument" 6 | exit 1 7 | fi 8 | 9 | # install libmpata++ 10 | cd libmpdata++/build 11 | sudo make install 12 | cd ../.. 13 | 14 | # working thrust version 15 | git clone --depth=1 git://github.com/thrust/thrust.git --branch 1.9.10-1; 16 | sudo ln -s `pwd`/thrust/thrust /usr/local/include/thrust; 17 | 18 | # libcloudph++ 19 | git clone --depth=1 git://github.com/igfuw/libcloudphxx.git 20 | cd libcloudphxx 21 | mkdir build 22 | cd build 23 | # RelWithDebInfo = Release with asserts 24 | cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ../ 25 | make 26 | sudo make install 27 | cd ../.. 28 | 29 | # UWLCM 30 | # if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost-program-options1.55-dev; fi 31 | git clone --depth=1 git://github.com/igfuw/UWLCM.git 32 | cd UWLCM 33 | . .travis_scripts/$1.sh 34 | cd .. 35 | set +e # see https://github.com/travis-ci/travis-ci/issues/6522 36 | 37 | -------------------------------------------------------------------------------- /.travis_scripts/bconds_div.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | cd tests/sandbox 4 | mkdir build 5 | cd build 6 | cmake .. 7 | VERBOSE=1 $make_j 8 | # running bconds_div in Release mode 9 | # "/" intentional! (just to make cat exit with an error code) 10 | OMP_NUM_THREADS=4 make -C 6_bconds_div test || cat 6_bconds_div/Testing/Temporary/LastTest.log / 11 | cd ../../.. 12 | -------------------------------------------------------------------------------- /.travis_scripts/elliptic_drop.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | # installing 4 | cd libmpdata++/build 5 | sudo make install 6 | cd ../.. 7 | # shallow-water-elliptic-drop 8 | git clone --depth=1 git://github.com/igfuw/shallow-water-elliptic-drop.git 9 | cd shallow-water-elliptic-drop/numerical 10 | mkdir build 11 | cd build 12 | cmake .. -DCMAKE_BUILD_TYPE=Release #TODO: Debug mode? 13 | make 14 | #- ./spreading_drop_2d_el 15 | # TODO: make test! 16 | cd ../../.. 17 | -------------------------------------------------------------------------------- /.travis_scripts/nair_jablonowski_2008.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | cd tests/nair_jablonowski_2008 4 | mkdir build 5 | cd build 6 | 7 | # compiling everything in the Release mode 8 | cmake -DCMAKE_BUILD_TYPE=Release ../ 9 | VERBOSE=1 $make_j 10 | 11 | # running tests in Release mode 12 | # "/" intentional! (just to make cat exit with an error code) 13 | OMP_NUM_THREADS=4 ctest -V -I 1,6 || cat Testing/Temporary/LastTest.log / 14 | cd ../../.. 15 | -------------------------------------------------------------------------------- /.travis_scripts/paper.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | cd tests/paper_2015_GMD 4 | mkdir build 5 | cd build 6 | cmake -DCMAKE_BUILD_TYPE=Debug ../ 7 | VERBOSE=1 make -C 6_coupled_harmosc 8 | # "/" intentional! (just to make cat exit with an error code) 9 | OMP_NUM_THREADS=4 make -C 6_coupled_harmosc test || cat 6_coupled_harmosc/Testing/Temporary/LastTest.log / 10 | 11 | # compiling everything in the Release mode 12 | cmake -DCMAKE_BUILD_TYPE=Release ../ 13 | VERBOSE=1 $make_j 14 | 15 | # running all paper tests in Release mode 16 | #- OMP_NUM_THREADS=1 make test || cat Testing/Temporary/LastTest.log / # "/" intentional! (just to make cat exit with an error code) 17 | # "/" intentional! (just to make cat exit with an error code) 18 | if [[ $MPI == 'none' ]]; then OMP_NUM_THREADS=4 make test || cat Testing/Temporary/LastTest.log /; fi 19 | 20 | # some tests take too long with mpi, so we skip them 21 | if [[ $MPI != 'none' ]]; then OMP_NUM_THREADS=4 make -C 0_basic_example test || cat 0_basic_example/Testing/Temporary/LastTest.log /; fi 22 | if [[ $MPI != 'none' ]]; then OMP_NUM_THREADS=4 make -C 1_advscheme_opts test || cat 1_advscheme_opts/Testing/Temporary/LastTest.log /; fi 23 | if [[ $MPI != 'none' ]]; then OMP_NUM_THREADS=4 make -C 7_shallow_water test || cat 7_shallow_water/Testing/Temporary/LastTest.log /; fi 24 | cd ../../.. 25 | -------------------------------------------------------------------------------- /.travis_scripts/pbl.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | cd tests/sandbox 4 | mkdir build 5 | cd build 6 | cmake .. 7 | # compiling and running pbl_iles on clang 8 | # "/" intentional! (just to make cat exit with an error code) 9 | if [[ $COMPILER == 'clang++' ]]; then VERBOSE=1 make pbl_iles_travis; fi 10 | if [[ $COMPILER == 'clang++' ]]; then OMP_NUM_THREADS=4 ctest -V -R pbl_iles_travis || cat Testing/Temporary/LastTest.log /; fi 11 | # smg on gcc 12 | if [[ $COMPILER == 'g++' ]]; then VERBOSE=1 make pbl_smg_travis; fi 13 | if [[ $COMPILER == 'g++' ]]; then OMP_NUM_THREADS=4 ctest -V -R pbl_smg_travis || cat Testing/Temporary/LastTest.log /; fi 14 | cd ../../.. 15 | -------------------------------------------------------------------------------- /.travis_scripts/sandbox.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | cd tests/sandbox 4 | mkdir build 5 | cd build 6 | cmake .. 7 | VERBOSE=1 $make_j 8 | # running selected sandbox tests in Release mode 9 | # "/" intentional! (just to make cat exit with an error code) 10 | OMP_NUM_THREADS=4 make -C mpi_adv test || cat mpi_adv/Testing/Temporary/LastTest.log / 11 | OMP_NUM_THREADS=4 ctest -R tgv_2d || cat Testing/Temporary/LastTest.log / 12 | OMP_NUM_THREADS=4 make -C convergence_2d_3d test || cat convergence_2d_3d/Testing/Temporary/LastTest.log / 13 | OMP_NUM_THREADS=4 travis_wait 30 make -C convergence_vip_1d test || cat convergence_vip_1d/Testing/Temporary/LastTest.log / 14 | if [[ $TRAVIS_OS_NAME == 'linux' ]]; then OMP_NUM_THREADS=4 make -C convergence_spacetime test || cat convergence_spacetime/Testing/Temporary/LastTest.log /; fi 15 | # with mpi it takes too long, bconds_div is ran in a separate test suite for mpi 16 | if [[ $MPI != 'none' ]]; then OMP_NUM_THREADS=4 make -C bconds_div test || cat bconds_div/Testing/Temporary/LastTest.log /; fi 17 | cd ../../.. 18 | -------------------------------------------------------------------------------- /.travis_scripts/setup_local_clang.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | mkdir local_clang 4 | cd local_clang 5 | export CLANG_VER=clang+llvm-6.0.0-x86_64-apple-darwin 6 | wget http://releases.llvm.org/6.0.0/$CLANG_VER.tar.xz 7 | tar -xf $CLANG_VER.tar.xz 8 | export LLVM_PATH=`pwd`/$CLANG_VER 9 | export CXX=$LLVM_PATH/bin/clang++ 10 | export LDFLAGS=$LDFLAGS" -L "$LLVM_PATH/lib" -Wl,-rpath,"$LLVM_PATH/lib 11 | export CPPFLAGS=$CPPFLAGS" -I"$LLVM_PATH/include" -I"$LLVM_PATH/include/c++/v1/ 12 | cd .. 13 | -------------------------------------------------------------------------------- /.travis_scripts/unit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | cd tests/unit 4 | mkdir build 5 | cd build 6 | cmake -DCMAKE_BUILD_TYPE=Debug ../ 7 | VERBOSE=1 $make_j 8 | # "/" intentional! (just to make cat exit with an error code) 9 | if [[ $MPI == 'none' ]]; then OMP_NUM_THREADS=4 make test || cat Testing/Temporary/LastTest.log /; fi 10 | 11 | # don't run Debug bconds, var_dt and absorber tests on MPI as it takes too long 12 | if [[ $MPI != 'none' ]]; then OMP_NUM_THREADS=2 make -C kahan_sum test || cat kahan_sum/Testing/Temporary/LastTest.log /; fi 13 | if [[ $MPI != 'none' ]]; then OMP_NUM_THREADS=2 make -C cone_bugs test || cat cone_bugs/Testing/Temporary/LastTest.log /; fi 14 | if [[ $MPI != 'none' ]]; then OMP_NUM_THREADS=2 make -C shallow_water test || cat shallow_water/Testing/Temporary/LastTest.log /; fi 15 | if [[ $MPI != 'none' ]]; then make -C concurrent_1d test || cat concurrent_1d/Testing/Temporary/LastTest.log /; fi 16 | if [[ $MPI != 'none' ]]; then OMP_NUM_THREADS=2 make -C git_revision test || cat git_revision/Testing/Temporary/LastTest.log /; fi 17 | 18 | cmake -DCMAKE_BUILD_TYPE=Release ../ 19 | # on MPI run absorber in release mode, bconds and var_dt take too long (why? they're fast on cuda-k-4) 20 | if [[ $MPI != 'none' ]]; then VERBOSE=1 make -C absorber; fi 21 | if [[ $MPI != 'none' ]]; then make -C absorber test || cat absorber/Testing/Temporary/LastTest.log /; fi 22 | 23 | if [[ $MPI == 'none' ]]; then VERBOSE=1 $make_j; fi 24 | # excluding test_issue because it (sometimes) fails in Release mode 25 | # for unknown reasons and it only seems to happen on Travis ... 26 | # "/" intentional! (just to make cat exit with an error code) 27 | if [[ $MPI == 'none' ]]; then OMP_NUM_THREADS=4 ctest -E test_issue || cat Testing/Temporary/LastTest.log /;fi 28 | cd ../../.. 29 | set +e 30 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | libmpdata++ is released under the GNU GPL v3 2 | see: http://www.gnu.org/licenses/gpl.html 3 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | Development of libmpdata++ has been carried out at the 2 | Faculty of Physics [1], University of Warsaw [2], Poland. 3 | The University of Warsaw holds the copyright to libmpdata++. 4 | 5 | The development was funded mainly by the Poland's National 6 | Science Centre (NCN, [3]). 7 | 8 | The development team consists of (in alphabetic order): 9 | 10 | Sylwester Arabas 11 | (core code, library design, OOP-formulae concepts [4], 12 | concurrency, gnuplot output) 13 | Piotr Dziekan 14 | Dorota Jarecka 15 | (shallow-water systems, OOP-formulae concepts [4]) 16 | Anna Jaruga 17 | (core code, non-oscillatory option, pressure solvers, 18 | automatic tests, OOP-formulae concepts [4], documentation [5]) 19 | Hanna Pawłowska 20 | (team management) 21 | Piotr Smolarkiewicz (the author of MPDATA) 22 | (consultancy, numerics, documentation [5]) 23 | Maciej Waruszewski 24 | (core code, extension to 3D, diffusion terms, 25 | non-carthesian geometry, performance optimisations, 26 | 3D visualisation, open & rigid boundary conditions, 27 | HDF5/XDMF output) 28 | 29 | [1]: http://www.fuw.edu.pl/ 30 | [2]: http://en.uw.edu.pl/ 31 | [3]: http://www.ncn.gov.pl/ 32 | [4]: http://dx.doi.org/10.3233/SPR-140379 33 | [5]: http://arxiv.org/abs/1407.1309 34 | http://www.geosci-model-dev-discuss.net/7/8179/2014/ 35 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | ARG DEBIAN_FRONTEND=noninteractive 4 | 5 | 6 | WORKDIR /usr/local/src/libmpdataxx 7 | 8 | RUN apt-get update -qq \ 9 | && apt-get install -yq --no-install-recommends \ 10 | sudo \ 11 | apt-utils \ 12 | build-essential \ 13 | pkg-config \ 14 | git \ 15 | cmake \ 16 | ca-certificates \ 17 | clang-4.0 \ 18 | software-properties-common \ 19 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 20 | 21 | RUN add-apt-repository ppa:ubuntu-toolchain-r/test \ 22 | && apt-get update -qq \ 23 | && apt-get install -yq --no-install-recommends \ 24 | libblitz0-dev \ 25 | libboost-all-dev \ 26 | gnuplot-nox \ 27 | wget \ 28 | libhdf5-dev \ 29 | hdf5-tools \ 30 | python-h5py \ 31 | python-scipy \ 32 | python-matplotlib \ 33 | gcc-6 g++-6 \ 34 | python3-dev \ 35 | python3-h5py \ 36 | python3-scipy \ 37 | python3-matplotlib \ 38 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 39 | 40 | ARG PYVER 41 | 42 | RUN if [ "$PYVER" = 3 ]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi 43 | 44 | RUN wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h 45 | 46 | COPY . . 47 | 48 | WORKDIR /usr/local/src/libmpdataxx/libmpdata++/build 49 | 50 | RUN cmake .. \ 51 | && make \ 52 | && make install 53 | 54 | WORKDIR /usr/local/src/libmpdataxx/ 55 | -------------------------------------------------------------------------------- /libmpdata++/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #fake 2 | cmake_minimum_required(VERSION 2.8.12) 3 | project(libmpdata++ CXX) 4 | 5 | # using include() istead of find_package(libmpdata++) to use local CMake code 6 | # and not the system-installed one 7 | include(${CMAKE_SOURCE_DIR}/../libmpdata++-config.cmake) 8 | if (NOT libmpdataxx_FOUND) 9 | message(FATAL_ERROR "local libmpdata++-config.cmake not found!") 10 | endif() 11 | 12 | # generate a header file with git revision id 13 | if (EXISTS "${CMAKE_SOURCE_DIR}/../.git") 14 | execute_process(COMMAND 15 | bash -c "git log -1 --format=\"format:#define LIBMPDATAXX_GIT_REVISION \\\"%H\\\"%n\" HEAD > git_revision.hpp" 16 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 17 | ) 18 | endif() 19 | 20 | install( 21 | DIRECTORY 22 | bcond concurr formulae output solvers 23 | DESTINATION 24 | include/libmpdata++ 25 | ) 26 | install( 27 | FILES 28 | blitz.hpp git_revision.hpp kahan_reduction.hpp opts.hpp 29 | DESTINATION 30 | include/libmpdata++ 31 | ) 32 | install( 33 | FILES 34 | ../libmpdata++-config.cmake 35 | DESTINATION 36 | share/libmpdata++ 37 | ) 38 | -------------------------------------------------------------------------------- /libmpdata++/bcond/detail/polar_common.hpp: -------------------------------------------------------------------------------- 1 | // common code for polar boundary conditions for libmpdata++ 2 | // 3 | // licensing: GPU GPL v3 4 | // copyright: University of Warsaw 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | namespace libmpdataxx 13 | { 14 | namespace bcond 15 | { 16 | namespace detail 17 | { 18 | using namespace arakawa_c; 19 | 20 | template 21 | class polar_common : public bcond_common 22 | { 23 | using parent_t = bcond_common; 24 | 25 | protected: 26 | 27 | // member fields 28 | const int pole; 29 | 30 | int polar_neighbours(const int j) 31 | { 32 | return (j + pole) % (2 * pole); 33 | } 34 | 35 | public: 36 | 37 | // ctor 38 | polar_common( 39 | const rng_t &i, 40 | const std::array &distmem_grid_size, 41 | bool = false, 42 | const int = -1, 43 | const int = -1 44 | ) : 45 | parent_t(i, distmem_grid_size), 46 | pole((distmem_grid_size[0] - 1) / 2) 47 | {} 48 | }; 49 | } // namespace detail 50 | } // namespace bcond 51 | } // namespace libmpdataxx 52 | -------------------------------------------------------------------------------- /libmpdata++/concurr/detail/timer.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright University of Warsaw 4 | * @section LICENSE 5 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 6 | */ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | namespace libmpdataxx 14 | { 15 | namespace concurr 16 | { 17 | namespace detail 18 | { 19 | class timer 20 | { 21 | std::unique_ptr tmr; 22 | bool started = false; 23 | 24 | public: 25 | 26 | // ctor 27 | timer() 28 | { 29 | tmr.reset(new boost::timer::cpu_timer()); 30 | } 31 | 32 | void resume() 33 | { 34 | if (started) tmr->resume(); 35 | else 36 | { 37 | started = true; 38 | tmr->start(); 39 | } 40 | } 41 | 42 | void stop() 43 | { 44 | tmr->stop(); 45 | } 46 | 47 | void print() 48 | { 49 | boost::timer::cpu_times t = tmr->elapsed(); 50 | std::ostringstream tmp; 51 | tmp << " wall time: " << double(t.wall) * 1e-9 << "s"; 52 | tmp << " user time: " << double(t.user) * 1e-9 << "s"; 53 | tmp << " system time: " << double(t.system) * 1e-9 << "s"; 54 | std::cerr << tmp.str() << std::endl; 55 | } 56 | }; 57 | } // namespace detail 58 | } // namespace solvers 59 | } // namespace libmpdataxx 60 | -------------------------------------------------------------------------------- /libmpdata++/concurr/serial.hpp: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @copyright University of Warsaw 3 | * @section LICENSE 4 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace libmpdataxx 12 | { 13 | namespace concurr 14 | { 15 | template < 16 | class solver_t, 17 | bcond::bcond_e bcxl, 18 | bcond::bcond_e bcxr, 19 | bcond::bcond_e bcyl = bcond::null, 20 | bcond::bcond_e bcyr = bcond::null, 21 | bcond::bcond_e bczl = bcond::null, 22 | bcond::bcond_e bczr = bcond::null 23 | > 24 | class serial : public detail::concurr_common 25 | { 26 | using parent_t = detail::concurr_common; 27 | 28 | 29 | struct mem_t : parent_t::mem_t 30 | { 31 | static int size() { return 1; } 32 | 33 | void barrier() { } 34 | 35 | // ctors 36 | mem_t(const std::array &grid_size) 37 | : parent_t::mem_t(grid_size, size()) 38 | {}; 39 | }; 40 | 41 | void solve(typename parent_t::advance_arg_t nt) 42 | { 43 | this->algos[0].solve(nt); 44 | } 45 | 46 | public: 47 | 48 | // ctor 49 | serial(const typename solver_t::rt_params_t &p) : 50 | parent_t(p, new mem_t(p.grid_size), mem_t::size()) 51 | {} 52 | 53 | }; 54 | } // namespace concurr 55 | } // namespace libmpdataxx 56 | -------------------------------------------------------------------------------- /libmpdata++/concurr/threads.hpp: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @copyright University of Warsaw 3 | * @section LICENSE 4 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 5 | */ 6 | 7 | // TODO: rename to auto? 8 | 9 | #pragma once 10 | 11 | #ifdef _OPENMP 12 | # include 13 | #else 14 | # include 15 | #endif 16 | 17 | namespace libmpdataxx 18 | { 19 | namespace concurr 20 | { 21 | /// @brief shared-memory concurency logic using threads 22 | /// (\ref libmpdataxx::concurr::openmp if supported, 23 | /// \ref libmpdataxx::concurr::boost_thread otherwise) 24 | template < 25 | class solver_t, 26 | bcond::bcond_e bcxl, 27 | bcond::bcond_e bcxr, 28 | bcond::bcond_e bcyl = bcond::null, 29 | bcond::bcond_e bcyr = bcond::null, 30 | bcond::bcond_e bczl = bcond::null, 31 | bcond::bcond_e bczr = bcond::null 32 | > using threads = 33 | #if defined(_OPENMP) 34 | openmp; 35 | #else 36 | boost_thread; 37 | #endif 38 | } // namespace concurr 39 | } // namespace libmpdataxx 40 | -------------------------------------------------------------------------------- /libmpdata++/formulae/arakawa_c.hpp: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @copyright University of Warsaw 3 | * @section LICENSE 4 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace libmpdataxx 12 | { 13 | namespace arakawa_c 14 | { 15 | namespace 16 | { 17 | struct hlf_t {} h; 18 | 19 | inline rng_t operator+( 20 | const rng_t &i, const hlf_t & 21 | ) { 22 | return i; 23 | } 24 | 25 | inline rng_t operator-( 26 | const rng_t &i, const hlf_t & 27 | ) { 28 | return i-1; 29 | } 30 | 31 | inline int operator+( 32 | const int i, const hlf_t & 33 | ) { 34 | return i; 35 | } 36 | 37 | inline int operator-( 38 | const int i, const hlf_t & 39 | ) { 40 | return i-1; 41 | } 42 | 43 | template 44 | inline rng_t operator^( 45 | const rng_t &r, const n_t &n 46 | ) { 47 | return rng_t( 48 | (r - n).first(), 49 | (r + n).last() 50 | ); 51 | } 52 | }; 53 | } // namespace arakawa_c 54 | } // namespace libmpdataxx 55 | -------------------------------------------------------------------------------- /libmpdata++/formulae/domain_decomposition.hpp: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @copyright University of Warsaw 3 | * @section LICENSE 4 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace libmpdataxx 12 | { 13 | namespace domain_decomposition 14 | { 15 | namespace detail 16 | { 17 | // helper methods to define subdomain ranges 18 | static int min(const int &span, const int &rank, const int &size) 19 | { 20 | return rank * span / size; 21 | } 22 | 23 | static int max(const int &span, const int &rank, const int &size) 24 | { 25 | return min(span, rank + 1, size) - 1; 26 | } 27 | }; 28 | 29 | // get part of 'span' assigned to 'rank' (out of 'size' ranks) 30 | static rng_t slab( 31 | const rng_t &span, 32 | const int &rank = 0, 33 | const int &size = 1 34 | ) { 35 | return rng_t( 36 | span.first() + detail::min(span.length(), rank, size), 37 | span.first() + detail::max(span.length(), rank, size) 38 | ); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /libmpdata++/formulae/kahan_sum.hpp: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @copyright University of Warsaw 3 | * @section LICENSE 4 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace libmpdataxx 10 | { 11 | namespace formulae 12 | { 13 | template 14 | inline void kahan_zro(a_t c, const a_t&, const a_t&, a_t sum) 15 | { 16 | sum = 0; 17 | c = 0; 18 | } 19 | 20 | template 21 | inline void kahan_add(a_t c, a_t y, a_t t, a_t sum, f_t input) 22 | { 23 | y = input - c; 24 | t = sum + y; 25 | c = (t - sum) - y; 26 | sum = t; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /libmpdata++/formulae/mpdata/formulae_mpdata_g_1d.hpp: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @copyright University of Warsaw 3 | * @section LICENSE 4 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 5 | */ 6 | 7 | // various numerical expressions relating to the G factor 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | namespace libmpdataxx 14 | { 15 | namespace formulae 16 | { 17 | namespace mpdata 18 | { 19 | // interpolation of G to (i+1/2) - general case 20 | template 21 | inline auto G_bar_x( 22 | const arr_1d_t &G, 23 | const ix_t &i, 24 | typename std::enable_if::type* = 0 25 | ) 26 | { 27 | return return_helper( 28 | ( 29 | formulae::G(G, i+1) + formulae::G(G, i) 30 | ) / 2 31 | ); 32 | } 33 | 34 | // interpolation of G to (i+1/2) - constant G version 35 | template 36 | inline auto G_bar_x( 37 | const arr_1d_t &G, 38 | const ix_t &i, 39 | typename std::enable_if::type* = 0 40 | ) 41 | { 42 | return 1; 43 | } 44 | } // namespace mpdata 45 | } // namespace formulae 46 | } // namespace libmpdataxx 47 | -------------------------------------------------------------------------------- /libmpdata++/formulae/mpdata/formulae_mpdata_hot_1d.hpp: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @copyright University of Warsaw 3 | * @section LICENSE 4 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | namespace libmpdataxx 14 | { 15 | namespace formulae 16 | { 17 | namespace mpdata 18 | { 19 | template 20 | forceinline_macro auto ndxx_psi_coeff( 21 | const arr_1d_t &GC, 22 | const arr_1d_t &G, 23 | const ix_t &i 24 | ) 25 | { 26 | return return_helper( 27 | ( 28 | 3 * GC(i+h) * abs(GC(i+h)) / G_bar_x(G, i) 29 | - 2 * pow3(GC(i+h)) / pow2(G_bar_x(G, i)) 30 | - GC(i+h) 31 | ) / 6 32 | ); 33 | } 34 | 35 | // third order terms 36 | template 37 | forceinline_macro auto TOT( 38 | const arr_1d_t &psi, 39 | const arr_1d_t &GC, 40 | const arr_1d_t &G, 41 | const ix_t &i, 42 | typename std::enable_if::type* = 0 43 | ) 44 | { 45 | return return_helper( 46 | ndxx_psi(psi, i) * ndxx_psi_coeff(GC, G, i) 47 | ); 48 | } 49 | 50 | template 51 | forceinline_macro auto TOT( 52 | const arr_1d_t &psi, 53 | const arr_1d_t &GC, 54 | const arr_1d_t &G, 55 | const ix_t &i, 56 | typename std::enable_if::type* = 0 57 | ) 58 | { 59 | return 0; 60 | } 61 | } // namespace mpdata 62 | } // namespace formulae 63 | } // namespcae libmpdataxx 64 | -------------------------------------------------------------------------------- /libmpdata++/kahan_reduction.hpp: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @copyright University of Warsaw 3 | * @section LICENSE 4 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | // local definition of a Kahan's sum reduction 12 | // (http://en.wikipedia.org/wiki/Kahan_summation_algorithm) 13 | namespace blitz 14 | { 15 | template 16 | class ReduceKahanSum 17 | { 18 | public: 19 | 20 | typedef P_sourcetype T_sourcetype; 21 | typedef P_resulttype T_resulttype; 22 | typedef T_resulttype T_numtype; 23 | 24 | static const bool needIndex = false, needInit = false; 25 | 26 | ReduceKahanSum() { } 27 | 28 | #pragma GCC push_options 29 | #pragma GCC optimize ("O3") // assuming -Ofast could optimise out the algorithm 30 | bool operator()(const T_sourcetype& x, const int=0) const 31 | { 32 | #if defined(__FAST_MATH__) && defined(__llvm__) 33 | volatile // without volatile clang optimises the algorithm out with -Ofast 34 | #endif 35 | T_resulttype t, y; 36 | y = x - c_; 37 | t = sum_ + y; 38 | c_ = (t - sum_) - y; 39 | sum_ = t; 40 | return true; 41 | } 42 | #pragma GCC pop_options 43 | 44 | T_resulttype result(const int) const { return sum_; } 45 | 46 | void reset() const 47 | { 48 | sum_ = c_ = zero(T_resulttype()); 49 | } 50 | 51 | static const char* name() { return "sum"; } 52 | 53 | protected: 54 | 55 | mutable T_resulttype sum_, c_; 56 | }; 57 | BZ_DECL_ARRAY_PARTIAL_REDUCE(kahan_sum, ReduceKahanSum) 58 | BZ_DECL_ARRAY_FULL_REDUCE(kahan_sum, ReduceKahanSum) 59 | } 60 | -------------------------------------------------------------------------------- /libmpdata++/solvers/detail/monitor.hpp: -------------------------------------------------------------------------------- 1 | // inspired by pulseaudio/src/pulsecore/thread-posix.c 2 | 3 | // TODO: the HAVE_PTHREAD_SETNAME_NP and HAVE_PTHREAD_GETNAME_NP are not yet defined anywhere! 4 | 5 | #pragma once 6 | 7 | #if defined(__linux__) 8 | # include // Linux ''standard'' 9 | #elif defined(HAVE_PTHREAD_SETNAME_NP) && defined(HAVE_PTHREAD_GETNAME_NP) 10 | # include // POSIX ''non-standard'' 11 | #endif 12 | 13 | namespace libmpdataxx 14 | { 15 | namespace solvers 16 | { 17 | namespace detail 18 | { 19 | inline void monitor(float frac) 20 | { 21 | char name[17]; 22 | #if defined(__linux__) 23 | name[16] = '\0'; 24 | prctl(PR_GET_NAME, name, 0, 0, 0); 25 | #elif defined(HAVE_PTHREAD_SETNAME_NP) && defined(HAVE_PTHREAD_GETNAME_NP) 26 | pthread_getname_np(pthread_self(), name, 16); 27 | #endif 28 | static int len = strlen(name); 29 | // ... 1 0 0 % \0 30 | // ... 10 11 12 13 14 15 31 | sprintf( 32 | &name[std::min(len, 10)], // taking care of short thread-names 33 | " %3d%%", 34 | int(frac * 100) 35 | ); 36 | #if defined(__linux__) 37 | prctl(PR_SET_NAME, name, 0, 0, 0); 38 | #elif defined(HAVE_PTHREAD_SETNAME_NP) && defined(HAVE_PTHREAD_GETNAME_NP) 39 | pthread_setname_np(name); 40 | #endif 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /libmpdata++/solvers/mpdata.hpp: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @copyright University of Warsaw 3 | * @section LICENSE 4 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | namespace libmpdataxx 18 | { 19 | namespace solvers 20 | { 21 | struct mpdata_family_tag {}; 22 | 23 | // the mpdata class 24 | template 25 | class mpdata 26 | {}; 27 | 28 | // oscillatory version 29 | template 30 | class mpdata< 31 | ct_params_t, minhalo, 32 | typename std::enable_if::type 33 | > : public detail::mpdata_osc 34 | { 35 | using parent_t = detail::mpdata_osc; 36 | using parent_t::parent_t; // inheriting constructors 37 | 38 | protected: 39 | using solver_family = mpdata_family_tag; 40 | }; 41 | 42 | // non-oscillatory version 43 | template 44 | class mpdata< 45 | ct_params_t, minhalo, 46 | typename std::enable_if::type 47 | > : public detail::mpdata_fct 48 | { 49 | using parent_t = detail::mpdata_fct; 50 | using parent_t::parent_t; // inheriting constructors 51 | 52 | protected: 53 | using solver_family = mpdata_family_tag; 54 | }; 55 | } // namespace solvers 56 | } // namescpae libmpdataxx 57 | -------------------------------------------------------------------------------- /tests/lauritzen_et_al_2012_GMD/gmd_2012.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * @file 3 | * @copyright University of Warsaw 4 | * @section LICENSE 5 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include "../mp3_paper_2018_JCP/reversing_deform/test_def.hpp" 16 | 17 | using namespace libmpdataxx; 18 | 19 | int main() 20 | { 21 | const bool var_dt = true; 22 | const T max_cfl = 0.90; 23 | 24 | std::vector nys = {120, 240}; 25 | { 26 | enum { opts = opts::nug}; 27 | const int opts_iters = 2; 28 | for (const auto ny : nys) test("nug_i2", ny, max_cfl); 29 | } 30 | 31 | { 32 | enum { opts = opts::nug | opts::iga | opts::fct}; 33 | const int opts_iters = 2; 34 | for (const auto ny : nys) test("nug_iga_fct_i2", ny, max_cfl); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tests/lauritzen_et_al_2012_GMD/refdata/stats_nug_i2_120.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/lauritzen_et_al_2012_GMD/refdata/stats_nug_i2_120.txt.gz -------------------------------------------------------------------------------- /tests/lauritzen_et_al_2012_GMD/refdata/stats_nug_i2_240.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/lauritzen_et_al_2012_GMD/refdata/stats_nug_i2_240.txt.gz -------------------------------------------------------------------------------- /tests/lauritzen_et_al_2012_GMD/refdata/stats_nug_iga_fct_i2_120.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/lauritzen_et_al_2012_GMD/refdata/stats_nug_iga_fct_i2_120.txt.gz -------------------------------------------------------------------------------- /tests/lauritzen_et_al_2012_GMD/refdata/stats_nug_iga_fct_i2_240.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/lauritzen_et_al_2012_GMD/refdata/stats_nug_iga_fct_i2_240.txt.gz -------------------------------------------------------------------------------- /tests/lauritzen_et_al_2012_GMD/stats_and_plots.py: -------------------------------------------------------------------------------- 1 | import h5py 2 | import numpy as np 3 | import os, sys 4 | sys.path.insert(1, os.path.join(os.path.dirname(__file__), '../mp3_paper_JCP/python_scripts')) 5 | sys.path.insert(1, os.path.join(os.path.dirname(__file__), '../mp3_paper_JCP/reversing_deform')) 6 | from mixing import calc_mixing_diags 7 | from helpers import prepare_data, calc_convergence 8 | from filaments import calc_filament_diags 9 | 10 | def solution(geo_data, field_data, field, ny): 11 | key = list(field_data[ny].keys())[0] 12 | return field_data[ny][key]['0.0'][field] 13 | 14 | def write_stats(conv, mixing_diags, filament_diags, opt, ny): 15 | outfile = open('stats_' + '_'.join(opt.decode('ASCII').split('|')) + '_i2_' + str(ny) + '.txt', 'w') 16 | 17 | errors_header = '{:6} {:8} {:8} {:8}\n'.format('field', 'L1', 'L2', 'Li') 18 | outfile.write(errors_header) 19 | 20 | for field in ['gh', 'cb', 'ccb', 'sc']: 21 | errs = {} 22 | for norm in ['L1', 'L2', 'Li']: 23 | errs[norm] = conv[opt][norm][field][ny] 24 | outfile.write('{:6} {L1:8.2e} {L2:8.2e} {Li:8.2e}\n'.format(field, **errs)) 25 | 26 | filaments_header = '\n{:4} {:6}\n'.format('tau', 'lf') 27 | outfile.write(filaments_header) 28 | for tau, lf in filament_diags[ny][opt]: 29 | outfile.write('{:4.2f} {:5.1f}\n'.format(tau, lf)) 30 | 31 | outfile.write('\nlr {:6.2e}\nlu {:6.2e}\nlo {:6.2e}\n'.format(*mixing_diags[ny][opt])) 32 | 33 | def main(): 34 | geo_data, field_data = prepare_data(sys.argv[1:]) 35 | conv = calc_convergence(geo_data, field_data, '5.0', solution) 36 | 37 | nys = [120, 240] 38 | 39 | mixing_diags = calc_mixing_diags(geo_data, field_data, nys) 40 | filament_diags = calc_filament_diags(geo_data, field_data, nys) 41 | 42 | for ny in nys: 43 | for opt in conv.keys(): 44 | write_stats(conv, mixing_diags, filament_diags, opt, ny) 45 | main() 46 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1) 2 | 3 | project(libmpdata++-tests-mp3_paper_2018_JCP CXX) 4 | 5 | include(${CMAKE_SOURCE_DIR}/../../libmpdata++-config.cmake) 6 | if(NOT libmpdataxx_FOUND) 7 | message(FATAL_ERROR "local libmpdata++-config.cmake not found!") 8 | endif() 9 | 10 | if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") 11 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${libmpdataxx_CXX_FLAGS_RELEASE}") 12 | set(CMAKE_CXX_FLAGS_RELEASE "") 13 | else() 14 | set(CMAKE_CXX_FLAGS_DEBUG ${libmpdataxx_CXX_FLAGS_DEBUG}) 15 | endif() 16 | 17 | # to make work 18 | set(CMAKE_CXX_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/../.. ${CMAKE_CXX_FLAGS}") 19 | 20 | if (NOT FULL_SIM) 21 | set(FULL_SIM "false") 22 | endif() 23 | 24 | # macro to be used in the subdirectories 25 | function(libmpdataxx_add_test test) 26 | add_executable(${test} ${test}.cpp) 27 | target_link_libraries(${test} ${libmpdataxx_LIBRARIES}) 28 | target_include_directories(${test} PUBLIC ${libmpdataxx_INCLUDE_DIRS}) 29 | target_compile_definitions(${test} PRIVATE FULL_SIM=${FULL_SIM}) 30 | add_test(${test} ${test}) 31 | endfunction() 32 | 33 | enable_testing() 34 | 35 | add_subdirectory(manufactured_3d) 36 | add_subdirectory(reversing_deform) 37 | add_subdirectory(moving_vort) 38 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/README.md: -------------------------------------------------------------------------------- 1 | ### The code reproducing the results of the numerical tests in Section 5 of the paper *["MPDATA: Third-order accuracy for variable flows" (J. Comput. Phys. 359 2018)](https://www.sciencedirect.com/science/article/pii/S0021999118300159)* : 2 | - Manufactured solution in 3D 3 | - Moving vortices 4 | - Reversing deformational flow 5 | 6 | In addition to the simulation code, the reference data used to obtain the paper plots is provided, as well as the Python 7 | scripts used to produce them. Running the tests will automatically produce plots and check the results against the reference data. 8 | 9 | ### Requirements 10 | - see the general libmpdata++ requirements https://github.com/igfuw/libmpdataxx/blob/master/README 11 | - the plotting scripts require Python with NumPy, Matplotlib (version 2.0.1 at least) and LaTeX 12 | 13 | ### Simulation time 14 | The full simulations are rather costly so by default the tests run a stripped-down version, without the 15 | finest grids. This is enough to reproduce most of the paper results aside from a few last points on the convergence plots. 16 | The stripped-down simulations still take about an hour on the 20 cores of a two-socket Xeon E5-2630 server. 17 | The full simulations take a couple of days on the same system. 18 | 19 | ### Building the tests 20 | 1. `$ mkdir build` 21 | 2. `$ cd build` 22 | 3. `$ cmake ..` for the default stripped-down simulations or `cmake .. -DFULL_SIM=true` for the full simulations 23 | 4. `$ make ` 24 | 25 | ### Running the tests 26 | `$ make test ` while in `build`. 27 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/manufactured_3d/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(manufactured_3d) 2 | 3 | add_test(manufactured_3d_stats_and_plots bash -c " 4 | python ${CMAKE_CURRENT_SOURCE_DIR}/stats_and_plots.py out*; 5 | ") 6 | 7 | add_test(manufactured_3d_conv_diff bash -c " 8 | diff ${CMAKE_CURRENT_SOURCE_DIR}/refdata/manufactured_3d_conv.txt ${CMAKE_CURRENT_BINARY_DIR}/manufactured_3d_conv.txt; 9 | ") 10 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/manufactured_3d/refdata/manufactured_3d_conv.txt: -------------------------------------------------------------------------------- 1 | Manufactured solution in 3D: convergence in the L2 error norm 2 | 3 | N Mp3 Mp3cc 4 | 9 1.14e-02 2.19e-02 5 | 17 1.49e-03 5.24e-03 6 | 33 1.80e-04 1.29e-03 7 | 65 2.16e-05 3.28e-04 8 | 129 2.71e-06 8.27e-05 9 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/manufactured_3d/stats_and_plots.py: -------------------------------------------------------------------------------- 1 | import h5py 2 | import numpy as np 3 | import os, sys 4 | sys.path.insert(1, os.path.join(os.path.dirname(__file__), '../python_scripts')) 5 | from helpers import prepare_data, calc_convergence, opt2lab, nested_dict, save_conv 6 | from conv_plot import conv_plot 7 | 8 | def solution(geo_data, field_data, field, ny): 9 | time = 1.0 10 | nx, ny, nz = geo_data[ny]['g'].shape 11 | X = geo_data[ny]['di'] * np.arange(nx) 12 | Y = geo_data[ny]['dj'] * np.arange(ny) 13 | Z = geo_data[ny]['dk'] * np.arange(nz) 14 | X, Y, Z = np.meshgrid(X, Y, Z, indexing ='ij') 15 | solution = (2 + np.sin(X) * np.sin(time)) *\ 16 | (2 + np.sin(Y) * np.sin(time)) *\ 17 | (2 + np.sin(Z) * np.sin(time)) 18 | return solution 19 | 20 | def main(): 21 | geo_data, field_data = prepare_data(sys.argv[1:]) 22 | conv = calc_convergence(geo_data, field_data, '1.0', solution) 23 | 24 | plot_data = [] 25 | norm = 'L2' 26 | field = 'psi' 27 | 28 | stat_file = open('manufactured_3d_conv.txt', 'w') 29 | save_conv(geo_data, conv, 'Manufactured solution in 3D', norm, field, stat_file) 30 | 31 | for opt in conv.keys(): 32 | nys, errs = zip(*sorted(conv[opt][norm][field].items())) 33 | plot_data.append((nys, errs, opt)) 34 | 35 | ord_data = [] 36 | ord2 = lambda n : 3e-2 * (n / float(9)) ** (-2) 37 | ny2 = np.array([40, 140]) 38 | nyt = 70 39 | ord_data.append((ny2, ord2(ny2), nyt, ord2(nyt+4), '2nd order', -92 - 180 / np.pi * np.arctan(-2))) 40 | 41 | ord3 = lambda n : 16e-3 * (n / float(9)) ** (-3) 42 | ny3 = np.array([40, 140]) 43 | nyt = 70 44 | ord_data.append((ny3, ord3(ny3), nyt, ord3(nyt+4), '3rd order', -110 - 180 / np.pi * np.arctan(-3))) 45 | 46 | conv_plot(plot_data, ord_data, fname = 'manufactured_3d_conv.pdf') 47 | 48 | main() 49 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/moving_vort/analytical_formulae.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | pi = np.pi 4 | 5 | def xpf(x, y, x0, y0): 6 | ret = np.arctan2(np.cos(y) * np.sin(x - x0), np.cos(y) * np.sin(y0) * np.cos(x - x0) - np.cos(y0) * np.sin(y)); 7 | return np.where(ret <= 0, ret + 2 * pi, ret) 8 | 9 | def ypf(x, y, x0, y0): 10 | return np.arcsin(np.sin(y) * np.sin(y0) + np.cos(y) * np.cos(y0) * np.cos(x - x0)) 11 | 12 | def ixpf(x, y, x0, y0): 13 | ret = x0 + np.arctan2(np.cos(y) * np.sin(x), np.sin(y) * np.cos(y0) + np.cos(y) * np.cos(x) * np.sin(y0)); 14 | return np.where(ret <= 0, ret + 2 * pi, ret) 15 | 16 | def iypf(x, y, x0, y0): 17 | return np.arcsin(np.sin(y) * np.sin(y0) - np.cos(y) * np.cos(y0) * np.cos(x)); 18 | 19 | def asolution(t, x, y, a = pi / 2): 20 | x0 = 3 * pi / 2 21 | y0 = 0.0 22 | u0 = 2 * pi / 12 23 | v0 = 2 * pi / 12 24 | 25 | xtmp = xpf(x0, y0, pi, pi / 2 - a) 26 | xtmp += u0 * t 27 | ytmp = ypf(x0, y0, pi, pi / 2 - a) 28 | 29 | xc = ixpf(xtmp, ytmp, pi, pi / 2 - a) 30 | yc = iypf(xtmp, ytmp, pi, pi / 2 - a) 31 | 32 | r = 3 * np.cos(ypf(x, y, xc, yc)) 33 | omg = np.where(r != 0, u0 * 3 * np.sqrt(2.) / (2 * r) * np.tanh(r) / (np.cosh(r) ** 2), 0) 34 | solution = 1 - np.tanh(r / 5 * np.sin(xpf(x, y, xc, yc) - omg * t)) 35 | return solution 36 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/moving_vort/moving_vort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "test_def.hpp" 3 | 4 | using namespace libmpdataxx; 5 | 6 | int main() 7 | { 8 | std::vector nys = {24, 48, 96, 192}; 9 | 10 | if (FULL_SIM) 11 | { 12 | nys.push_back(384); 13 | nys.push_back(768); 14 | } 15 | 16 | const bool var_dt = true; 17 | const T max_cfl = 1.0; 18 | 19 | for (const auto ny : nys) 20 | { 21 | { 22 | enum { opts = opts::nug | opts::iga | opts::fct}; 23 | const int opts_iters = 2; 24 | test("Mg2No", ny, max_cfl); 25 | } 26 | 27 | { 28 | enum { opts = opts::nug | opts::abs | opts::div_2nd | opts::div_3rd}; 29 | const int opts_iters = 2; 30 | test("Mp3", ny, max_cfl); 31 | } 32 | 33 | { 34 | enum { opts = opts::nug | opts::abs | opts::tot}; 35 | const int opts_iters = 3; 36 | test("Mp3cc", ny, max_cfl); 37 | } 38 | 39 | { 40 | enum { opts = opts::nug | opts::iga | opts::div_2nd | opts::div_3rd | opts::fct}; 41 | const int opts_iters = 2; 42 | test("Mg3No", ny, max_cfl); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/moving_vort/refdata/moving_vort_conv.txt: -------------------------------------------------------------------------------- 1 | Moving vortices: convergence in the L2 error norm 2 | 3 | N Mp3 Mp3cc Mg2No Mg3No 4 | 24 5.02e-02 5.23e-02 6.98e-02 4.96e-02 5 | 48 3.06e-02 3.02e-02 5.30e-02 2.80e-02 6 | 96 1.08e-02 1.03e-02 3.28e-02 9.80e-03 7 | 192 1.29e-03 1.36e-03 1.39e-02 1.64e-03 8 | 384 1.23e-04 1.96e-04 4.40e-03 3.80e-04 9 | 768 1.22e-05 4.01e-05 1.15e-03 8.18e-05 10 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/moving_vort/refdata/out_Mp3_192/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/moving_vort/refdata/out_Mp3_192/const.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/moving_vort/refdata/out_Mp3_192/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/moving_vort/refdata/out_Mp3_192/timestep0000000000.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/moving_vort/refdata/out_Mp3_192/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/moving_vort/refdata/out_Mp3_192/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/moving_vort/refdata/out_Mp3_192/timestep0000047421.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/moving_vort/refdata/out_Mp3_192/timestep0000047421.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/moving_vort/refdata/out_Mp3_192/timestep0000047421.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/moving_vort/stats_and_plots.py: -------------------------------------------------------------------------------- 1 | import h5py 2 | import numpy as np 3 | import os, sys 4 | sys.path.insert(1, os.path.join(os.path.dirname(__file__), '../python_scripts')) 5 | from helpers import prepare_data, calc_convergence, save_conv 6 | from conv_plot import conv_plot 7 | from time import clock 8 | from analytical_formulae import asolution, pi 9 | from panel_plot import panel_plot 10 | 11 | def solution(geo_data, field_data, field, ny): 12 | nx, ny = geo_data[ny]['g'].shape 13 | X = geo_data[ny]['di'] * np.arange(nx) 14 | Y = geo_data[ny]['dj'] * (np.arange(ny) + 0.5) - pi / 2 15 | X, Y = np.meshgrid(X, Y, indexing ='ij') 16 | 17 | return asolution(12.0, X, Y) 18 | 19 | def main(): 20 | geo_data, field_data = prepare_data(sys.argv[1:], chosen_times = ['0.0', '12.0']) 21 | conv = calc_convergence(geo_data, field_data, '12.0', solution) 22 | 23 | plot_data = [] 24 | norm = 'L2' 25 | field = 'psi' 26 | 27 | stat_file = open('moving_vort_conv.txt', 'w') 28 | save_conv(geo_data, conv, 'Moving vortices', norm, field, stat_file) 29 | 30 | for opt in conv.keys(): 31 | nys, errs = zip(*sorted(conv[opt][norm][field].items())) 32 | plot_data.append((nys, errs, opt)) 33 | 34 | ord_data = [] 35 | ord2 = lambda n : 2e-0 * (n / 24.) ** (-2) 36 | ny2 = np.array([300, 900]) 37 | nyt = 450 38 | ord_data.append((ny2, ord2(ny2), nyt, ord2(nyt+10), '2nd order', -94 - 180 / pi * np.arctan(-2))) 39 | 40 | ord3 = lambda n : 1e-1 * (n / 24.) ** (-3) 41 | ny3 = np.array([300, 900]) 42 | nyt = 480 43 | ord_data.append((ny3, ord3(ny3), nyt, ord3(nyt+20), '3rd order', -113 - 180 / pi * np.arctan(-3))) 44 | 45 | conv_plot(plot_data, ord_data, fname = 'moving_vort_conv.pdf') 46 | 47 | panel_plot(geo_data, field_data, opt = 'nug|abs|div_2nd|div_3rd', time = '12.0', ny = 192, fname = 'moving_vort_panel.pdf') 48 | 49 | main() 50 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/moving_vort/transforms.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | using T = double; 7 | constexpr T pi = boost::math::constants::pi(); 8 | 9 | // forward transformations 10 | struct xpf_t 11 | { 12 | T x0, y0; 13 | T operator()(T x, T y) const 14 | { 15 | T ret = atan2(cos(y) * sin(x - x0), cos(y) * sin(y0) * cos(x - x0) - cos(y0) * sin(y)); 16 | return ret <= 0 ? ret + 2 * pi : ret; 17 | } 18 | BZ_DECLARE_FUNCTOR2(xpf_t); 19 | }; 20 | 21 | struct ypf_t 22 | { 23 | T x0, y0; 24 | T operator()(T x, T y) const 25 | { 26 | return asin(sin(y) * sin(y0) + cos(y) * cos(y0) * cos(x - x0)); 27 | } 28 | BZ_DECLARE_FUNCTOR2(ypf_t); 29 | }; 30 | 31 | // inverse transformations 32 | struct ixpf_t 33 | { 34 | T x0, y0; 35 | T operator()(T x, T y) const 36 | { 37 | 38 | T ret = x0 + atan2(cos(y) * sin(x), sin(y) * cos(y0) + cos(y) * cos(x) * sin(y0)); 39 | return ret <= 0 ? ret + 2 * pi : ret; 40 | } 41 | BZ_DECLARE_FUNCTOR2(ixpf_t); 42 | }; 43 | 44 | struct iypf_t 45 | { 46 | T x0, y0; 47 | T operator()(T x, T y) const 48 | { 49 | return asin(sin(y) * sin(y0) - cos(y) * cos(y0) * cos(x)); 50 | } 51 | BZ_DECLARE_FUNCTOR2(iypf_t); 52 | }; 53 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/filaments.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from helpers import nested_dict 3 | 4 | def calc_filament_diags(geo_data, field_data, nys): 5 | filament_diags = nested_dict() 6 | 7 | taus = np.linspace(0.10, 1.0, 19) 8 | eps = 1e-12 9 | 10 | for ny in nys: 11 | g = geo_data[ny]['g'] 12 | 13 | for opt in field_data[ny]: 14 | lfs = [] 15 | for tau in taus: 16 | area_0 = np.sum(g[field_data[ny][opt]['0.0']['cb'] >= tau - eps]) 17 | area_h = np.sum(g[field_data[ny][opt]['2.5']['cb'] >= tau - eps]) 18 | if area_0 < eps: 19 | lf = 0 20 | else: 21 | lf = 100 * area_h / area_0 22 | lfs.append(lf) 23 | 24 | filament_diags[ny][opt] = list(zip(taus, lfs)) 25 | 26 | return filament_diags 27 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/panel_plot.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from helpers import set_rc_params 3 | import matplotlib.pyplot as plt 4 | from matplotlib.ticker import ScalarFormatter 5 | from matplotlib.ticker import FormatStrFormatter 6 | import os 7 | 8 | def panel_plot(plot_data, fname = 'panel.pdf'): 9 | set_rc_params(tickfs = 30) 10 | 11 | levels = np.linspace(-0.05, 1.15, 25) 12 | 13 | fig, axarr = plt.subplots(2, 2, figsize=(20, 14), sharex = 'col', sharey = 'row') 14 | field2pos = {'gh' : (0, 0), 'cb' : (0, 1), 'ccb' : (1, 1), 'sc' : (1, 0) } 15 | field2title = {'gh' : '(a) Gaussian hills', 16 | 'cb' : '(b) cosine bells', 17 | 'ccb' : "(d) 'correlated' cosine bells", 18 | 'sc' : '(c) slotted cylinders'} 19 | 20 | for f in plot_data.keys(): 21 | field = np.transpose(plot_data[f]) 22 | ny, nx = field.shape 23 | cmap = plt.get_cmap('terrain') 24 | i = field2pos[f] 25 | p = axarr[i].contourf(field, levels = levels, zorder = 1, cmap = cmap) 26 | axarr[i].contour(field, levels = levels, zorder = 1, cmap = cmap) 27 | axarr[i].set_title(field2title[f], fontsize = 30, y = 1.02) 28 | 29 | for ax in axarr.flatten(): 30 | ax.set_xticks([0, (nx - 1) / 4, (nx - 1) / 2, 3 * (nx - 1) / 4, nx - 1]) 31 | ax.set_xticklabels([r'$0$', r'$\pi$/2', r'$\pi$', r'$3\pi/2$', r'$2\pi$']) 32 | 33 | ax.set_yticks([0, (ny+0.5) / 2, ny - 1]) 34 | ax.set_yticklabels([r'$-\pi/2$', r'$0$', r'$\pi/2$']) 35 | ax.grid(color = 'w', lw = 2, linestyle = ':') 36 | 37 | plt.subplots_adjust(bottom=0.2) 38 | 39 | cbaxes = fig.add_axes([0.1, 0.1, 0.8, 0.02]) 40 | plt.colorbar(p, cax = cbaxes, ticks = levels[1:-1:2], orientation = 'horizontal') 41 | 42 | #plt.tight_layout(pad=1., w_pad=5., h_pad=1) 43 | plt.savefig(fname, bbox_inches='tight') 44 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/common/timestep0000000000_240.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/common/timestep0000000000_240.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg2No_240/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg2No_240/const.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg2No_240/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg2No_240/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000_240.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg2No_240/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg2No_240/timestep0000000908.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg2No_240/timestep0000000908.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg2No_240/timestep0000000908.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg2No_240/timestep0000001816.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg2No_240/timestep0000001816.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg2No_240/timestep0000001816.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/const.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/timestep0000000000.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/timestep0000000454.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/timestep0000000454.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/timestep0000000454.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/timestep0000000908.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/timestep0000000908.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_120/timestep0000000908.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_240/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_240/const.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_240/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_240/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000_240.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_240/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_240/timestep0000000908.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_240/timestep0000000908.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_240/timestep0000000908.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_240/timestep0000001816.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_240/timestep0000001816.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mg3No_240/timestep0000001816.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3_240/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3_240/const.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3_240/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3_240/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000_240.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3_240/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3_240/timestep0000000908.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3_240/timestep0000000908.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3_240/timestep0000000908.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3_240/timestep0000001816.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3_240/timestep0000001816.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3_240/timestep0000001816.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3cc_240/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3cc_240/const.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3cc_240/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3cc_240/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000_240.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3cc_240/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3cc_240/timestep0000000908.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3cc_240/timestep0000000908.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3cc_240/timestep0000000908.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3cc_240/timestep0000001816.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3cc_240/timestep0000001816.h5 -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/out_Mp3cc_240/timestep0000001816.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/reversing_deform_conv.txt: -------------------------------------------------------------------------------- 1 | Reversing deformational flow: convergence in the L2 error norm 2 | 3 | N Mp3 Mp3cc Mg2No Mg3No 4 | 60 3.23e-01 3.29e-01 2.80e-01 2.67e-01 5 | 120 1.18e-01 1.22e-01 1.08e-01 9.86e-02 6 | 240 2.35e-02 2.47e-02 2.98e-02 2.18e-02 7 | 480 3.27e-03 3.58e-03 6.56e-03 3.19e-03 8 | 960 4.15e-04 4.66e-04 1.56e-03 4.39e-04 9 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/refdata/reversing_deform_mixing.txt: -------------------------------------------------------------------------------- 1 | Reversing deformational flow: mixing diagnostics for the N = 240 (0.75 degree interval) simulations 2 | 3 | Mp3 Mp3cc Mg2No Mg3No 4 | lr 1.28e-03 1.64e-03 8.85e-04 7.56e-04 5 | lu 2.00e-04 3.46e-04 2.77e-04 2.32e-04 6 | lo 6.99e-04 7.14e-04 0.00e+00 0.00e+00 7 | -------------------------------------------------------------------------------- /tests/mp3_paper_2018_JCP/reversing_deform/reversing_deform.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "test_def.hpp" 9 | 10 | using namespace libmpdataxx; 11 | 12 | int main() 13 | { 14 | const bool var_dt = true; 15 | const T max_cfl = 0.8; 16 | 17 | std::vector nys = {60, 120, 240, 480}; 18 | 19 | if (FULL_SIM) 20 | { 21 | nys.push_back(960); 22 | } 23 | 24 | for (const auto ny : nys) 25 | { 26 | { 27 | enum { opts = opts::nug | opts::iga | opts::fct}; 28 | const int opts_iters = 2; 29 | test("Mg2No", ny, max_cfl); 30 | } 31 | 32 | { 33 | enum { opts = opts::nug | opts::abs | opts::div_2nd | opts::div_3rd}; 34 | const int opts_iters = 2; 35 | test("Mp3", ny, max_cfl); 36 | } 37 | 38 | { 39 | enum { opts = opts::nug | opts::abs | opts::tot}; 40 | const int opts_iters = 3; 41 | test("Mp3cc", ny, max_cfl); 42 | } 43 | 44 | { 45 | enum { opts = opts::nug | opts::iga | opts::div_2nd | opts::div_3rd | opts::fct}; 46 | const int opts_iters = 2; 47 | test("Mg3No", ny, max_cfl); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(APPLE) 2 | # needed for the XCode clang to be identified as AppleClang and not Clang 3 | cmake_minimum_required(VERSION 3.0) 4 | else() 5 | # needed for the OpenMP test to work in C++-only project 6 | # (see http://public.kitware.com/Bug/view.php?id=11910) 7 | cmake_minimum_required(VERSION 2.8.8) 8 | endif() 9 | 10 | project(libmpdata++-tests-nair_jablonowski_2008 CXX) 11 | 12 | include(${CMAKE_SOURCE_DIR}/../../libmpdata++-config.cmake) 13 | if(NOT libmpdataxx_FOUND) 14 | message(FATAL_ERROR "local libmpdata++-config.cmake not found!") 15 | endif() 16 | 17 | if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") 18 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${libmpdataxx_CXX_FLAGS_RELEASE}") 19 | set(CMAKE_CXX_FLAGS_RELEASE "") 20 | else() 21 | set(CMAKE_CXX_FLAGS_DEBUG ${libmpdataxx_CXX_FLAGS_DEBUG}) 22 | endif() 23 | 24 | # to make work 25 | set(CMAKE_CXX_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/../.. ${CMAKE_CXX_FLAGS}") 26 | 27 | # macro to be used in the subdirectories 28 | function(libmpdataxx_add_test test) 29 | add_executable(${test} ${test}.cpp) 30 | target_link_libraries(${test} ${libmpdataxx_LIBRARIES}) 31 | target_include_directories(${test} PUBLIC ${libmpdataxx_INCLUDE_DIRS}) 32 | if(USE_MPI) 33 | add_test(NAME ${test} COMMAND ${libmpdataxx_MPIRUN} -np 3 ${CMAKE_CURRENT_BINARY_DIR}/${test}) # TODO: why 3? :) 34 | else() 35 | add_test(${test} ${test}) 36 | endif() 37 | endfunction() 38 | 39 | enable_testing() 40 | 41 | #polar bconds don't work with mpi yet 42 | if(NOT USE_MPI) 43 | add_subdirectory(stationary) 44 | endif() 45 | #add_subdirectory(moving) 46 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/moving.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace libmpdataxx; 3 | 4 | #include "../common/convergence.hpp" 5 | #include "../../mp3_paper_2018_JCP/moving_vort/test_def.hpp" 6 | 7 | int main() 8 | { 9 | #if defined(USE_MPI) 10 | // we will instantiate many solvers, so we have to init mpi manually, 11 | // because solvers will not know should they finalize mpi upon destruction 12 | MPI::Init_thread(MPI_THREAD_MULTIPLE); 13 | #endif 14 | const bool var_dt = true; 15 | const T max_cfl = 0.99; 16 | { 17 | enum { opts = opts::nug }; 18 | const int opts_iters = 2; 19 | convergence(test, "nug_i2", max_cfl); 20 | } 21 | 22 | { 23 | enum { opts = opts::nug | opts::iga | opts::fct}; 24 | const int opts_iters = 2; 25 | convergence(test, "nug_iga_fct_i2", max_cfl); 26 | } 27 | #if defined(USE_MPI) 28 | MPI::Finalize(); 29 | #endif 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/moving_tot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace libmpdataxx; 3 | 4 | #include "../common/convergence.hpp" 5 | #include "../../mp3_paper_2018_JCP/moving_vort/test_def.hpp" 6 | 7 | int main() 8 | { 9 | #if defined(USE_MPI) 10 | // we will instantiate many solvers, so we have to init mpi manually, 11 | // because solvers will not know should they finalize mpi upon destruction 12 | MPI::Init_thread(MPI_THREAD_MULTIPLE); 13 | #endif 14 | const bool var_dt = true; 15 | const T max_cfl = 0.99; 16 | 17 | { 18 | enum { opts = opts::nug | opts::tot}; 19 | const int opts_iters = 3; 20 | convergence(test, "nug_tot_i3", max_cfl); 21 | } 22 | 23 | { 24 | enum { opts = opts::nug | opts::iga | opts::tot | opts::fct}; 25 | const int opts_iters = 2; 26 | convergence(test, "nug_iga_tot_fct_i2", max_cfl); 27 | } 28 | #if defined(USE_MPI) 29 | MPI::Finalize(); 30 | #endif 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/common/timestep0000000000.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_i2_96/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_i2_96/const.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_i2_96/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_i2_96/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_i2_96/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_i2_96/timestep0000006004.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_i2_96/timestep0000006004.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_i2_96/timestep0000006004.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_i2_96/timestep0000012008.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_i2_96/timestep0000012008.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_i2_96/timestep0000012008.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_fct_i2_96/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_iga_fct_i2_96/const.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_fct_i2_96/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_fct_i2_96/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_fct_i2_96/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_fct_i2_96/timestep0000006004.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_iga_fct_i2_96/timestep0000006004.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_fct_i2_96/timestep0000006004.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_fct_i2_96/timestep0000012008.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_iga_fct_i2_96/timestep0000012008.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_fct_i2_96/timestep0000012008.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_tot_fct_i2_96/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_iga_tot_fct_i2_96/const.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_tot_fct_i2_96/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_tot_fct_i2_96/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_tot_fct_i2_96/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_tot_fct_i2_96/timestep0000006004.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_iga_tot_fct_i2_96/timestep0000006004.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_tot_fct_i2_96/timestep0000006004.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_tot_fct_i2_96/timestep0000012008.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_iga_tot_fct_i2_96/timestep0000012008.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_iga_tot_fct_i2_96/timestep0000012008.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_tot_i3_96/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_tot_i3_96/const.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_tot_i3_96/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_tot_i3_96/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_tot_i3_96/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_tot_i3_96/timestep0000006004.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_tot_i3_96/timestep0000006004.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_tot_i3_96/timestep0000006004.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_tot_i3_96/timestep0000012008.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/nug_tot_i3_96/timestep0000012008.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/nug_tot_i3_96/timestep0000012008.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/stats_nug_i2.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/stats_nug_i2.txt.gz -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/stats_nug_iga_fct_i2.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/stats_nug_iga_fct_i2.txt.gz -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/stats_nug_iga_tot_fct_i2.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/stats_nug_iga_tot_fct_i2.txt.gz -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/moving/refdata/stats_nug_tot_i3.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/moving/refdata/stats_nug_tot_i3.txt.gz -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/common/timestep0000000000.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_i2_96/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_i2_96/const.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_i2_96/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_i2_96/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_i2_96/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_i2_96/timestep0000001492.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_i2_96/timestep0000001492.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_i2_96/timestep0000001492.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_i2_96/timestep0000002983.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_i2_96/timestep0000002983.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_i2_96/timestep0000002983.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_fct_i2_96/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_iga_fct_i2_96/const.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_fct_i2_96/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_fct_i2_96/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_fct_i2_96/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_fct_i2_96/timestep0000001492.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_iga_fct_i2_96/timestep0000001492.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_fct_i2_96/timestep0000001492.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_fct_i2_96/timestep0000002983.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_iga_fct_i2_96/timestep0000002983.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_fct_i2_96/timestep0000002983.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_tot_fct_i2_96/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_iga_tot_fct_i2_96/const.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_tot_fct_i2_96/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_tot_fct_i2_96/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_tot_fct_i2_96/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_tot_fct_i2_96/timestep0000001492.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_iga_tot_fct_i2_96/timestep0000001492.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_tot_fct_i2_96/timestep0000001492.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_tot_fct_i2_96/timestep0000002983.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_iga_tot_fct_i2_96/timestep0000002983.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_iga_tot_fct_i2_96/timestep0000002983.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_tot_i3_96/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_tot_i3_96/const.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_tot_i3_96/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_tot_i3_96/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_tot_i3_96/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_tot_i3_96/timestep0000001492.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_tot_i3_96/timestep0000001492.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_tot_i3_96/timestep0000001492.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_tot_i3_96/timestep0000002983.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/nug_tot_i3_96/timestep0000002983.h5 -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/nug_tot_i3_96/timestep0000002983.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/stats_nug_i2.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/stats_nug_i2.txt.gz -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/stats_nug_iga_fct_i2.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/stats_nug_iga_fct_i2.txt.gz -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/stats_nug_iga_tot_fct_i2.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/stats_nug_iga_tot_fct_i2.txt.gz -------------------------------------------------------------------------------- /tests/nair_jablonowski_2008/stationary/refdata/stats_nug_tot_i3.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/nair_jablonowski_2008/stationary/refdata/stats_nug_tot_i3.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/0_basic_example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test_gi(basic_example true) 2 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/0_basic_example/basic_example.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace libmpdataxx; 6 | 7 | int main() 8 | { 9 | // compile-time parameters 10 | struct ct_params_t : ct_params_default_t 11 | { 12 | using real_t = double; 13 | enum { n_dims = 1 }; 14 | enum { n_eqns = 1 }; 15 | }; 16 | 17 | // solver choice 18 | using slv_t = solvers::mpdata; 19 | 20 | // output choice 21 | using slv_out_t = output::gnuplot; 22 | 23 | // concurency choice 24 | using run_t = concurr::serial< 25 | slv_out_t, bcond::open, bcond::open 26 | >; //left bcond //right bcond 27 | 28 | // run-time parameters 29 | typename slv_out_t::rt_params_t p; 30 | 31 | int nx = 101, nt = 100; 32 | ct_params_t::real_t dx = 0.1; 33 | 34 | p.grid_size = { nx }; 35 | p.outfreq = 20; 36 | 37 | // instantiation 38 | run_t run(p); 39 | 40 | // initial condition 41 | blitz::firstIndex i; 42 | // Witch of Agnesi with a=.5 43 | run.advectee() = -.5 + 1 / ( 44 | pow(dx*(i - (nx-1)/2.), 2) + 1 45 | ); 46 | // Courant number 47 | run.advector() = .5; 48 | 49 | // integration 50 | run.advance(nt); 51 | } 52 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/0_basic_example/refdata/log-orig.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/0_basic_example/refdata/log-orig.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/1_advscheme_opts/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test_gi(advscheme_opts true) 2 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/1_advscheme_opts/refdata/log-orig.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/1_advscheme_opts/refdata/log-orig.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/2_convergence_1d/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(convergence_1d) 2 | if(NOT USE_MPI) 3 | add_test( 4 | NAME convergence_1d_diff 5 | COMMAND bash -c " 6 | for i in ${CMAKE_CURRENT_SOURCE_DIR}/refdata/*.txt.gz; do 7 | echo \$i ; 8 | echo compare to ; 9 | echo ${CMAKE_CURRENT_BINARY_DIR}/`basename \${i/.gz/}`; 10 | zdiff \$i ${CMAKE_CURRENT_BINARY_DIR}/`basename \${i/.gz/}` || exit 1; 11 | done; 12 | " 13 | ) 14 | add_test( 15 | NAME convergence_1d_plot 16 | COMMAND bash -c " 17 | for i in ${CMAKE_CURRENT_SOURCE_DIR}/refdata/*.txt.gz; do 18 | python3 ${CMAKE_CURRENT_SOURCE_DIR}/plot.py ${CMAKE_CURRENT_BINARY_DIR}/`basename \${i/.gz/}`; 19 | done; 20 | " 21 | ) 22 | endif() 23 | set_property(TEST convergence_1d PROPERTY LABELS SlowWithMpi) # the test is super slow with MPI, make it easy to disable it 24 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=1.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=1.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=2.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=2.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=2_fct.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=2_fct.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=3.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=3.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=3_tot.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=3_tot.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=i.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=i.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=i_fct.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=i_fct.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=i_fct_tot.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/2_convergence_1d/refdata/err_mpdata_iters=i_fct_tot.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/3_rotating_cone_2d/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test_gi(rotating_cone_2d false) # disable comparison of data sent to Gnuplot, because the data depends on compiler's optimization (result of blitz::rint in particular?) 2 | if(NOT USE_MPI) 3 | add_test( 4 | NAME rotating_cone_stats_diff 5 | COMMAND bash -c "for i in stats*.txt; do 6 | zdiff ${CMAKE_CURRENT_SOURCE_DIR}/refdata/$i.gz $i || exit 1; 7 | done" 8 | ) 9 | endif() 10 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/3_rotating_cone_2d/refdata/log-orig.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/3_rotating_cone_2d/refdata/log-orig.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/3_rotating_cone_2d/refdata/stats_basic_.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/3_rotating_cone_2d/refdata/stats_basic_.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/3_rotating_cone_2d/refdata/stats_fct_.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/3_rotating_cone_2d/refdata/stats_fct_.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/3_rotating_cone_2d/refdata/stats_iga_fct_.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/3_rotating_cone_2d/refdata/stats_iga_fct_.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/3_rotating_cone_2d/refdata/stats_iga_tot_fct_.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/3_rotating_cone_2d/refdata/stats_iga_tot_fct_.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/3_rotating_cone_2d/refdata/stats_iters3_tot_fct_.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/3_rotating_cone_2d/refdata/stats_iters3_tot_fct_.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/basic/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/basic/const.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/basic/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/basic/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/basic/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/basic/timestep0000000556.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/basic/timestep0000000556.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/basic/timestep0000000556.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/common/timestep0000000000.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/fct/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/fct/const.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/fct/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/fct/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/fct/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/fct/timestep0000000556.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/fct/timestep0000000556.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/fct/timestep0000000556.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga/const.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga/timestep0000000556.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga/timestep0000000556.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga/timestep0000000556.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga_fct/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga_fct/const.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga_fct/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga_fct/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga_fct/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga_fct/timestep0000000556.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga_fct/timestep0000000556.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/iga_fct/timestep0000000556.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/stats_basic.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/stats_basic.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/stats_fct.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/stats_fct.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/stats_iga.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/stats_iga.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/stats_iga_fct.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/stats_iga_fct.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/stats_upwind.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/stats_upwind.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/upwind/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/upwind/const.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/upwind/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/upwind/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/upwind/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/upwind/timestep0000000556.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/upwind/timestep0000000556.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/4_revolving_sphere_3d/refdata/upwind/timestep0000000556.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/cmap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/best/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/5_over_the_pole_2d/refdata/best/const.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/best/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/best/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/best/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/best/timestep0000005120.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/5_over_the_pole_2d/refdata/best/timestep0000005120.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/best/timestep0000005120.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/common/timestep0000000000.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/5_over_the_pole_2d/refdata/common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/default/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/5_over_the_pole_2d/refdata/default/const.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/default/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/default/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/default/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/default/timestep0000005120.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/5_over_the_pole_2d/refdata/default/timestep0000005120.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/default/timestep0000005120.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/stats_best.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/5_over_the_pole_2d/refdata/stats_best.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/5_over_the_pole_2d/refdata/stats_default.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/5_over_the_pole_2d/refdata/stats_default.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/6_coupled_harmosc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test_gi(coupled_harmosc true) 2 | if(NOT USE_MPI) 3 | add_test( 4 | NAME harmosc_stats_diff 5 | COMMAND zdiff ${CMAKE_CURRENT_SOURCE_DIR}/refdata/stats.txt.gz stats.txt 6 | ) 7 | endif() 8 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/6_coupled_harmosc/refdata/log-orig.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/6_coupled_harmosc/refdata/log-orig.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/6_coupled_harmosc/refdata/stats.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/6_coupled_harmosc/refdata/stats.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/analytic_eq.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import math 3 | from scipy.optimize import fsolve 4 | from scipy.integrate import odeint 5 | 6 | #eq. 5.6 (Schar&Smolarkiewicz, 1996) 7 | def d1_lambda_eq(x, *time): 8 | return 0.5 * ((x*(x-1.))**0.5 + math.log((x-1.)**0.5 + x**0.5)) - time 9 | 10 | # finging roots of lambda_eq 11 | def d1_lambda_evol(time, x0=1): 12 | return fsolve(d1_lambda_eq, x0, args=time) 13 | 14 | #eq. 5.4 (Schar&Smolarkiewicz, 1996) 15 | def d1_height(lamb, x): 16 | return np.where(x**2 <= lamb**2, lamb**-1 * (1. - (x/lamb)**2), 0) 17 | 18 | #eq. 5.5 (Schar&Smolarkiewicz, 1996) 19 | def d1_velocity(lamb, x): 20 | lamb_t = 2 * (1 - lamb**-1)**0.5 21 | return np.where(x**2 <= lamb**2, x * lamb_t / lamb, 0) 22 | 23 | #eq. 5.3 (Schar&Smolarkiewicz, 1996) 24 | def d1_initial(x): 25 | return np.where(x**2<=1, 1-x**2, 0) 26 | 27 | 28 | def d2_rad2(x,y): 29 | return x**2 + y**2 30 | 31 | def d2_lambda_evol(time): 32 | return (2*time**2 + 1)**0.5 33 | 34 | def d2_height(lamb, x, y): 35 | return np.where(d2_rad2(x,y) <= lamb**2, lamb**-2 * (1. - d2_rad2(x,y)/lamb**2), 0) 36 | 37 | # height in 2d 38 | def d2_height_plane(lamb, x, y): 39 | X, Y = np.meshgrid(x, y) 40 | return np.where(d2_rad2(X,Y) <= lamb**2, lamb**-2 * (1. - d2_rad2(X,Y)/lamb**2), 0) 41 | 42 | def d2_velocity(lamb, x, y): 43 | lamb_t = 2**0.5 * (1 - lamb**-2)**0.5 44 | return np.where(d2_rad2(x,y) <= lamb**2, x * lamb_t / lamb, 0) 45 | 46 | #initial condition 47 | def d2_initial(x,y): 48 | return np.where(d2_rad2(x,y)<=1, 1-d2_rad2(x,y), 0) 49 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/plot_settings.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | from matplotlib.font_manager import FontProperties 3 | 4 | def ticks_changes(ax): 5 | # removing some ticks' labels 6 | for i, tick in enumerate(ax.xaxis.get_major_ticks() + ax.yaxis.get_major_ticks()): 7 | if i % 2 != 0: 8 | tick.label1On = False 9 | 10 | # changing ticks' size 11 | for item in plt.xticks()[1] + plt.yticks()[1]: 12 | item.set_fontsize(15) 13 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_abs/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_abs/const.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_abs/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000_1d.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_abs/timestep0000000300.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_abs/timestep0000000300.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_abs_stats.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_abs_stats.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_iga/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_iga/const.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_iga/coord.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_iga/coord.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_iga/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000_1d.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_iga/timestep0000000300.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_iga/timestep0000000300.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_iga_stats.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/1d_fct_iga_stats.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_abs/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_abs/const.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_abs/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_abs/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000_2d.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_abs/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_abs/timestep0000000300.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_abs/timestep0000000300.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_abs/timestep0000000300.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_abs_stats.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_abs_stats.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_iga/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_iga/const.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_iga/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_iga/timestep0000000000.h5: -------------------------------------------------------------------------------- 1 | ../common/timestep0000000000_2d.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_iga/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_iga/timestep0000000300.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_iga/timestep0000000300.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_iga/timestep0000000300.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_iga_stats.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/2d_fct_iga_stats.txt.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/common/timestep0000000000_1d.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/common/timestep0000000000_1d.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/7_shallow_water/refdata/common/timestep0000000000_2d.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/7_shallow_water/refdata/common/timestep0000000000_2d.h5 -------------------------------------------------------------------------------- /tests/paper_2015_GMD/8_boussinesq_2d/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test_gi(boussinesq_2d false) # don't compare results point-by-point with reference, because compiler optimization (-Ofast) affects them a little 2 | if(NOT USE_MPI) 3 | add_test( 4 | NAME boussinesq_stats_diff 5 | COMMAND zdiff ${CMAKE_CURRENT_SOURCE_DIR}/refdata/stats.txt.gz stats.txt 6 | ) 7 | endif() 8 | 9 | set_property(TEST init_boussinesq_2d calc_boussinesq_2d clean_boussinesq_2d PROPERTY LABELS SlowWithMpi) 10 | -------------------------------------------------------------------------------- /tests/paper_2015_GMD/8_boussinesq_2d/refdata/log-orig.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/8_boussinesq_2d/refdata/log-orig.gz -------------------------------------------------------------------------------- /tests/paper_2015_GMD/8_boussinesq_2d/refdata/stats.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/paper_2015_GMD/8_boussinesq_2d/refdata/stats.txt.gz -------------------------------------------------------------------------------- /tests/sandbox/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(APPLE) 2 | # needed for the XCode clang to be identified as AppleClang and not Clang 3 | cmake_minimum_required(VERSION 3.0) 4 | else() 5 | # needed for the OpenMP test to work in C++-only project 6 | # (see http://public.kitware.com/Bug/view.php?id=11910) 7 | cmake_minimum_required(VERSION 2.8.8) 8 | endif() 9 | 10 | project(libmpdata++-tests-sandbox CXX) 11 | 12 | include(${CMAKE_SOURCE_DIR}/../../libmpdata++-config.cmake) 13 | if(NOT libmpdataxx_FOUND) 14 | message(FATAL_ERROR "local libmpdata++-config.cmake not found!") 15 | endif() 16 | 17 | if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") 18 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${libmpdataxx_CXX_FLAGS_RELEASE}") 19 | set(CMAKE_CXX_FLAGS_RELEASE "") 20 | else() 21 | set(CMAKE_CXX_FLAGS_DEBUG ${libmpdataxx_CXX_FLAGS_DEBUG}) 22 | endif() 23 | 24 | # to make work 25 | set(CMAKE_CXX_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}/../.. ${CMAKE_CXX_FLAGS}") 26 | 27 | # macros to be used in the subdirectories 28 | function(libmpdataxx_add_test test) 29 | add_executable(${test} ${test}.cpp) 30 | target_link_libraries(${test} ${libmpdataxx_LIBRARIES}) 31 | target_include_directories(${test} PUBLIC ${libmpdataxx_INCLUDE_DIRS}) 32 | if(USE_MPI) 33 | add_test(NAME ${test} COMMAND ${libmpdataxx_MPIRUN} -np 3 ${CMAKE_CURRENT_BINARY_DIR}/${test}) # TODO: why 3? :) 34 | else() 35 | add_test(${test} ${test}) 36 | endif() 37 | endfunction() 38 | 39 | enable_testing() 40 | 41 | add_subdirectory(mpi_adv) 42 | add_subdirectory(straka) 43 | add_subdirectory(tgv) 44 | add_subdirectory(convergence_2d_3d) 45 | add_subdirectory(pbl) 46 | add_subdirectory(convergence_spacetime) 47 | add_subdirectory(bconds_div) 48 | add_subdirectory(shear_layer) 49 | add_subdirectory(convergence_vip_1d) 50 | add_subdirectory(convergence_adv_diffusion) 51 | -------------------------------------------------------------------------------- /tests/sandbox/bconds_div/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(bconds_div_2d) 2 | libmpdataxx_add_test(bconds_div_3d) 3 | -------------------------------------------------------------------------------- /tests/sandbox/bconds_div/bconds_div.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | template 5 | class bconds_div : public libmpdataxx::solvers::boussinesq 6 | { 7 | using parent_t = libmpdataxx::solvers::boussinesq; 8 | 9 | protected: 10 | 11 | const std::string error_str; 12 | 13 | void hook_post_step() final 14 | { 15 | auto gc_div = this->max_abs_vctr_div(this->mem->GC); 16 | 17 | if (gc_div > 2 * this->prs_tol) 18 | { 19 | if (this->rank == 0) 20 | { 21 | std::cout << "bconds: " << error_str 22 | << " gc_div: " << gc_div << std::endl; 23 | } 24 | this->mem->barrier(); 25 | throw std::runtime_error(""); 26 | } 27 | 28 | parent_t::hook_post_step(); 29 | } 30 | 31 | public: 32 | 33 | struct rt_params_t : parent_t::rt_params_t 34 | { 35 | std::string error_str; 36 | }; 37 | 38 | bconds_div( 39 | typename parent_t::ctor_args_t args, 40 | const rt_params_t &p 41 | ) : 42 | parent_t(args, p), 43 | error_str(p.error_str) 44 | {} 45 | }; 46 | -------------------------------------------------------------------------------- /tests/sandbox/convergence_2d_3d/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(convergence_2d) 2 | libmpdataxx_add_test(convergence_3d) 3 | -------------------------------------------------------------------------------- /tests/sandbox/convergence_adv_diffusion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(convergence_adv_diffusion) 2 | set_property(TEST convergence_adv_diffusion PROPERTY LABELS SlowWithMpi) 3 | -------------------------------------------------------------------------------- /tests/sandbox/convergence_spacetime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(convergence_1d_spacetime) 2 | libmpdataxx_add_test(convergence_2d_spacetime) 3 | libmpdataxx_add_test(convergence_3d_spacetime) 4 | -------------------------------------------------------------------------------- /tests/sandbox/convergence_spacetime/convergence_1d_spacetime.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright University of Warsaw 4 | * @section LICENSE 5 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 6 | */ 7 | 8 | #pragma once 9 | #include 10 | 11 | template 12 | class convergence_1d_spacetime : public libmpdataxx::solvers::mpdata 13 | { 14 | using parent_t = libmpdataxx::solvers::mpdata; 15 | using parent_t::parent_t; 16 | 17 | public: 18 | 19 | using real_t = typename ct_params_t::real_t; 20 | 21 | protected: 22 | 23 | real_t advector(real_t t, real_t x) 24 | { 25 | return cos(t) * exp(cos(x)) / (2 + sin(x) * sin(t)); 26 | } 27 | 28 | bool calc_gc() final 29 | { 30 | using libmpdataxx::opts::isset; 31 | using libmpdataxx::opts::div_3rd; 32 | using namespace libmpdataxx::arakawa_c; 33 | 34 | auto t = this->time; 35 | auto dt = this->dt; 36 | 37 | for (int i = this->i.first()-1; i <= this->i.last(); ++i) // starting at i.first()-1, because MPI requires that vector to the left of the domain is calculated by thread rank 0 38 | { 39 | auto x = (i+0.5) * this->di; 40 | this->mem->GC[0](i+h) = dt / this->di * advector(t + 0.5 * dt, x); 41 | 42 | if (isset(ct_params_t::opts, div_3rd)) 43 | { 44 | this->mem->ndt_GC[0](i+h) = dt / this->di * (advector(t, x) - advector(t - dt, x)); 45 | this->mem->ndtt_GC[0](i+h) = dt / this->di * (advector(t, x) + advector(t - 2 * dt, x) - 2 * advector(t - dt, x)); 46 | } 47 | } 48 | 49 | this->xchng_vctr_alng(this->mem->GC); 50 | if (isset(ct_params_t::opts, div_3rd)) 51 | { 52 | this->xchng_vctr_alng(this->mem->ndt_GC); 53 | this->xchng_vctr_alng(this->mem->ndtt_GC); 54 | } 55 | 56 | return true; 57 | } 58 | }; 59 | -------------------------------------------------------------------------------- /tests/sandbox/convergence_vip_1d/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(convergence_vip_1d) 2 | -------------------------------------------------------------------------------- /tests/sandbox/dcmip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(dcmip_1) 2 | #libmpdataxx_add_test(dcmip_2) 3 | -------------------------------------------------------------------------------- /tests/sandbox/mpi_adv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(mpi_adv_2d) 2 | libmpdataxx_add_test(mpi_adv_3d) 3 | -------------------------------------------------------------------------------- /tests/sandbox/pbl/pbl_iles.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright University of Warsaw 4 | * @section LICENSE 5 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 6 | */ 7 | 8 | #include "pbl_test_def.hpp" 9 | 10 | int main() 11 | { 12 | test("out_pbl_iles", 65, 1501); 13 | } 14 | -------------------------------------------------------------------------------- /tests/sandbox/pbl/pbl_iles_short.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright University of Warsaw 4 | * @section LICENSE 5 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 6 | */ 7 | 8 | #include "pbl_test_def.hpp" 9 | 10 | int main() 11 | { 12 | test("out_pbl_iles_short", 33, 601); 13 | } 14 | -------------------------------------------------------------------------------- /tests/sandbox/pbl/pbl_smg.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright University of Warsaw 4 | * @section LICENSE 5 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 6 | */ 7 | 8 | #include "pbl_test_def.hpp" 9 | 10 | int main() 11 | { 12 | test("out_pbl_smg", 65, 1501); 13 | } 14 | -------------------------------------------------------------------------------- /tests/sandbox/pbl/pbl_smg_short.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright University of Warsaw 4 | * @section LICENSE 5 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 6 | */ 7 | 8 | #include "pbl_test_def.hpp" 9 | 10 | int main() 11 | { 12 | test("out_pbl_smg_short", 33, 601); 13 | } 14 | -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/budget_pbl_iles_short.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/sandbox/pbl/refdata/budget_pbl_iles_short.h5 -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/budget_pbl_smg_short.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/sandbox/pbl/refdata/budget_pbl_smg_short.h5 -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_iles_short/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/sandbox/pbl/refdata/out_pbl_iles_short/const.h5 -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_iles_short/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_iles_short/timestep0000000000.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/sandbox/pbl/refdata/out_pbl_iles_short/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_iles_short/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_iles_short/timestep0000000600.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/sandbox/pbl/refdata/out_pbl_iles_short/timestep0000000600.h5 -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_iles_short/timestep0000000600.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_smg_short/const.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/sandbox/pbl/refdata/out_pbl_smg_short/const.h5 -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_smg_short/temp.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_smg_short/timestep0000000000.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/sandbox/pbl/refdata/out_pbl_smg_short/timestep0000000000.h5 -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_smg_short/timestep0000000000.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_smg_short/timestep0000000600.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/sandbox/pbl/refdata/out_pbl_smg_short/timestep0000000600.h5 -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/out_pbl_smg_short/timestep0000000600.xmf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/profiles_pbl_iles_short.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/sandbox/pbl/refdata/profiles_pbl_iles_short.txt.gz -------------------------------------------------------------------------------- /tests/sandbox/pbl/refdata/profiles_pbl_smg_short.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igfuw/libmpdataxx/49669934337d6615983ea9aaf47fab515df782f1/tests/sandbox/pbl/refdata/profiles_pbl_smg_short.txt.gz -------------------------------------------------------------------------------- /tests/sandbox/shear_layer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(shear_layer) 2 | set_property(TEST shear_layer PROPERTY LABELS SlowWithMpi) 3 | -------------------------------------------------------------------------------- /tests/sandbox/straka/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(straka) 2 | set_property(TEST straka PROPERTY LABELS SlowWithMpi) 3 | -------------------------------------------------------------------------------- /tests/sandbox/tgv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(tgv_2d) 2 | libmpdataxx_add_test(tgv_3d) 3 | set_property(TEST tgv_3d PROPERTY LABELS SlowWithMpi) 4 | -------------------------------------------------------------------------------- /tests/unit/absorber/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(absorber) 2 | -------------------------------------------------------------------------------- /tests/unit/bconds/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(bconds) 2 | -------------------------------------------------------------------------------- /tests/unit/concurrent_1d/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(test_concurrent_1d) 2 | -------------------------------------------------------------------------------- /tests/unit/cone_bugs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(test_issue) 2 | -------------------------------------------------------------------------------- /tests/unit/delayed_advection/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(delayed_advection) 2 | -------------------------------------------------------------------------------- /tests/unit/git_revision/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(test_git_revision) 2 | -------------------------------------------------------------------------------- /tests/unit/git_revision/test_git_revision.cpp: -------------------------------------------------------------------------------- 1 | // unit test for the git_revision.h file 2 | // 3 | // author[s]: Sylwester Arabas 4 | // licensing: GPU GPL v3 5 | // copyright: University of Warsaw 6 | 7 | #include 8 | 9 | #include 10 | 11 | int main() 12 | { 13 | std::cerr << LIBMPDATAXX_GIT_REVISION << std::endl; 14 | } 15 | -------------------------------------------------------------------------------- /tests/unit/hdf5_catch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(test_hdf5_catch) 2 | -------------------------------------------------------------------------------- /tests/unit/hdf5_catch/test_hdf5_catch.cpp: -------------------------------------------------------------------------------- 1 | // unit test for HDF5 exception passing through libmpdata++ 2 | // 3 | // author[s]: Sylwester Arabas 4 | // licensing: GPU GPL v3 5 | // copyright: University of Warsaw 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | using namespace libmpdataxx; 12 | 13 | int main() 14 | { 15 | // compile-time parameters 16 | struct ct_params_t : ct_params_default_t 17 | { 18 | using real_t = double; 19 | enum { n_dims = 1 }; 20 | enum { n_eqns = 1 }; 21 | enum { rhs_scheme = solvers::euler_a }; 22 | }; 23 | 24 | // solver & output choice 25 | using solver_t = output::hdf5>; 26 | 27 | // run-time parameters 28 | solver_t::rt_params_t p; 29 | 30 | p.grid_size = { 10 }; 31 | p.outdir = boost::filesystem::unique_path().native(); 32 | 33 | // instantiation 34 | concurr::serial< 35 | solver_t, 36 | bcond::cyclic, bcond::cyclic 37 | > run(p); 38 | 39 | // integration 40 | bool caught = false; 41 | try 42 | { 43 | run.advector() = 0; 44 | run.advectee() = 0; 45 | run.advance(1); 46 | boost::filesystem::rename(boost::filesystem::path(p.outdir), boost::filesystem::path(p.outdir + ".off")); 47 | run.advance(1); // this will fail and trow a HDF exception 48 | } 49 | catch (H5::Exception) 50 | { 51 | std::cerr << "error caught!" << std::endl; 52 | caught = true; 53 | } 54 | if (!caught) exit(EXIT_FAILURE); 55 | }; 56 | -------------------------------------------------------------------------------- /tests/unit/hint_scale/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(hint_scale) 2 | -------------------------------------------------------------------------------- /tests/unit/kahan_sum/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(test_kahan_sum) 2 | -------------------------------------------------------------------------------- /tests/unit/kahan_sum/test_kahan_sum.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | template 5 | void main_tmpl() 6 | { 7 | //////////////////////////////////////////////////////////////// 8 | // Kahan sum reduction test 9 | if (sizeof(real_t) == sizeof(float)) 10 | { 11 | blitz::Array a(10), rev(10); 12 | a = 1e-8; 13 | a(0) = 1e8; 14 | std::cerr << std::setprecision(20); 15 | std::cerr 16 | << a 17 | << " blitz::sum = " << blitz::sum(a) << std::endl 18 | << " kahan_sum = " << blitz::kahan_sum(a) << std::endl; 19 | rev = a.reverse(0); 20 | std::cerr 21 | << rev 22 | << "rev + blitz::sum = " << blitz::sum(rev) << std::endl 23 | << "rev + kahan_sum = " << blitz::kahan_sum(rev) << std::endl; 24 | 25 | // expected without Kahan sum 26 | auto expected_diff = 1.4e-8; 27 | 28 | // that's why we might need a Kahan sum 29 | if (std::abs(blitz::sum(a) - blitz::sum(rev)) < expected_diff) 30 | throw std::runtime_error("A"); 31 | // that's to show it works 32 | if (std::abs(blitz::kahan_sum(a) - blitz::kahan_sum(rev)) > expected_diff) 33 | throw std::runtime_error("B"); 34 | } 35 | } 36 | 37 | int main() 38 | { 39 | main_tmpl(); 40 | main_tmpl(); 41 | main_tmpl(); 42 | } 43 | -------------------------------------------------------------------------------- /tests/unit/shallow_water/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(test_shallow_water_2d) 2 | -------------------------------------------------------------------------------- /tests/unit/var_dt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | libmpdataxx_add_test(var_dt_test) 2 | set_property(TEST var_dt_test PROPERTY LABELS SlowWithMpi) # the test is super slow with MPI, make it easy to disable it 3 | -------------------------------------------------------------------------------- /tests/unit/var_dt/var_dt_test.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @copyright University of Warsaw 4 | * @section LICENSE 5 | * GPLv3+ (see the COPYING file or http://www.gnu.org/licenses/) 6 | */ 7 | 8 | #pragma once 9 | #include 10 | 11 | template 12 | class var_dt_test : public libmpdataxx::solvers::mpdata 13 | { 14 | using parent_t = libmpdataxx::solvers::mpdata; 15 | 16 | public: 17 | 18 | using real_t = typename ct_params_t::real_t; 19 | 20 | protected: 21 | 22 | real_t pi, u_0, tau; 23 | 24 | bool calc_gc() final 25 | { 26 | auto t_half = this->time + 0.5 * this->dt; 27 | using namespace libmpdataxx::arakawa_c; 28 | for (int i = this->i.first(); i <= this->i.last(); ++i) 29 | { 30 | this->mem->GC[0](i-h) = this->dt / this->di * u_0 * cos(pi * t_half / tau); // vector to the left of the domain also has to be set 31 | } 32 | this->xchng_vctr_alng(this->mem->GC); 33 | return true; 34 | } 35 | 36 | public: 37 | 38 | struct rt_params_t : parent_t::rt_params_t 39 | { 40 | real_t pi, u_0, tau; 41 | }; 42 | 43 | // ctor 44 | var_dt_test( 45 | typename parent_t::ctor_args_t args, 46 | const rt_params_t &p 47 | ) : 48 | parent_t(args, p), 49 | pi(p.pi), 50 | u_0(p.u_0), 51 | tau(p.tau) 52 | {} 53 | }; 54 | --------------------------------------------------------------------------------