This archive contains the source code for reproduction of all
results presented in Section 4.1 and Section 4.3 of the publication

"Randomized Local Model Order Reduction"
by Andreas Buhr and Kathrin Smetana

In order to execute the code on a freshly installed
Ubuntu 16.04.2 LTS system, enter the following lines into
a shell:

sudo apt-get install python-pip python-virtualenv python-numpy python-scipy python-pyside cython python-matplotlib python-dev python git python-pil python-progress
export PATH_TO_VIRTUALENV=~/pymor-virtualenv
virtualenv --system-site-packages $PATH_TO_VIRTUALENV
source $PATH_TO_VIRTUALENV/bin/activate
pip install git+https://github.com/pymor/pymor.git@0.4.x
pip install git+https://github.com/sdrave/simdb.git@143d6b9f9f5b7bf55ab2bf56d3cb19166cc1abcb
pip install scipy==1.0.0
export SIMDB_PATH=~/pymor-simdb

to reproduce Table 4.1, run
python cpu_times/measure_cpu_times.py
-> results will be on stdout.

Note that results of CPU timings
vary from run to run, due to the randomized nature 
of the algorithm.

to reproduce Figure 4.1, run
python 4_1/experiment_twosquares_images.py
-> result will be in modes.dat and omodes.dat

To reproduce Figure 4.2a, run
python 4_1/experiment_twosquares_svddecay.py
python 4_1/experiment_twosquares_algo_convergence.py
python 4_1/postprocessing_twosquares_operatornorm_decay.py
-> result will be in twosquares_percentiles.dat

To reproduce Figure 4.2b, run
python 4_1/experiment_twosquares_svddecay.py
python 4_1/experiment_twosquares_algo_convergence.py
python 4_1/postprocessing_twosquares_operatornorm_decay.py
python 4_1/postprocessing_twosquares_a_priori_comparison.py
-> result will be in twosquares_means.dat and twosquares_expectation.dat

To reproduce Figure 4.3a, run
python 4_1/experiment_twosquares_svddecay.py
python 4_1/experiment_twosquares_algo_convergence.py
python 4_1/postprocessing_twosquares_adaptive_convergence.py
-> result will be in twosquares_adaptive_convergence.dat

To reproduce Figure 4.3b, run
python 4_1/experiment_twosquares_svddecay.py
python 4_1/experiment_twosquares_algo_convergence.py
python 4_1/postprocessing_twosquares_adaptive_num_testvecs.py
-> result will be in twosquares_adaptive_num_testvecs.dat 

To reproduce Figure 4.4a and 4.4b, run
python 4_1/experiment_h_svddecay.py
python 4_1/experiment_h_algo_convergence.py
python 4_1/postprocessing_h.py
-> result will be in experiment_h_deviation.dat and experiment_h_testvecs.dat

To reproduce Figure 4.5a, run
python 4_1/experiment_twosquares_algo_convergence.py
python 4_1/postprocessing_twosquares_testvecnorms.py
-> result will be in twosquares_testvecnorms.dat (col 5 / col 3)

To reproduce Figure 4.5b, run
python 4_1/experiment_twosquares_algo_convergence.py
python 4_1/postprocessing_twosquares_testvecnorms.py
-> result will be in twosquares_testvecnorms.dat (col 1 to col 5)

To reproduce Figure 4.6, run
python 4_2/helmholtz.py
-> result will be in "helmholtz_selected.dat" (for left figure)
   and "helmholtz_3d.dat" (for right figure)

To reproduce Figure 4.7a, run
python 4_2/helmholtz.py
python 4_2/postprocessing_helmholtz_operatornorm_decay.py
-> result will be in "helmholtz_percentiles.dat"

To reproduce Figure 4.7b, run
python 4_2/helmholtz.py
python 4_2/postprocessing_helmholtz_a_priori_comparison.py
python 4_2/postprocessing_helmholtz_operatornorm_decay.py
-> results will be in "helmholtz_expectation.dat" and "helmholtz_means.dat"

To reproduce Figure 4.8a, run
python 4_2/helmholtz.py
python 4_2/postprocessing_helmholtz_adaptive_convergence.py
-> result will be in "helmholtz_adaptive_convergence.dat"

To reproduce Figure 4.8b, run
python 4_2/helmholtz.py
python 4_2/postprocessing_helmholtz_adaptive_num_testvecs.py
-> result will be in "helmholtz_adaptive_num_testvecs.dat"

To reproduce Figure 4.12, left, run
python 4_4/experiment_svddecay.py
python 4_4/postprocessing_svddecay.py
python 4_4/experiment_random_basis_convergence.py
python 4_4/postprocessing_random_basis_convergence.py
-> result will be in maxsvd_poisson.dat and local_global_errors_poisson.dat

To reproduce Figure 4.12, right, run
python 4_4/experiment_svddecay.py
python 4_4/postprocessing_svddecay.py
python 4_4/experiment_random_basis_convergence.py
python 4_4/postprocessing_random_basis_convergence.py
-> result will be in maxsvd_H.dat and local_global_errors_H.dat

To reproduce Figure 4.13, left, run
python 4_4/experiment_local_approximations.py
python 4_4/postprocessing_local_approximations.py
-> result will be in local_approximations_poisson.dat

To reproduce Figure 4.13, right, run
python 4_4/experiment_local_approximations.py
python 4_4/postprocessing_local_approximations.py
-> result will be in local_approximations_h.dat

To reproduce Figure 4.14, left, run
python 4_4/experiment_global_approximation.py
python 4_4/postprocessing_global_approximation.py
-> result will be in global_approximations_poisson.dat

To reproduce Figure 4.14, right, run
python 4_4/experiment_global_approximation.py
python 4_4/postprocessing_global_approximation.py
-> result will be in global_approximations_h.dat

