diff --git a/genetIC/tests/run_tests.sh b/genetIC/tests/run_tests.sh index 74bab145..6ef392b6 100755 --- a/genetIC/tests/run_tests.sh +++ b/genetIC/tests/run_tests.sh @@ -36,6 +36,10 @@ function runtest { if [ "$#" -eq 0 ]; then for i in test_* do + if [ "$i" == "test_24b_splicing_potential" ] + then + export OMP_NUM_THREADS=1 + fi runtest $i done else diff --git a/genetIC/tests/test_24b_splicing_potential/animate.py b/genetIC/tests/test_24b_splicing_potential/animate.py new file mode 100644 index 00000000..990d820c --- /dev/null +++ b/genetIC/tests/test_24b_splicing_potential/animate.py @@ -0,0 +1,44 @@ +import subprocess +import plotslice as ps +import pylab as p + +def run_genetic(sphere_size): + st = """ +Om 0.279 +Ol 0.721 +#Ob 0.04 +s8 0.817 +zin 99 + +random_seed_real_space 8896131 +camb ../camb_transfer_kmax40_z0.dat + +outname test_1 +outdir ./ +outformat tipsy + + +basegrid 50.0 128 + +center 25 25 25 +select_sphere %.1f +splice 8896132 + +done + +dump_ps 0 +dump_grid 0"""%sphere_size + + with open("paramfile_anim.txt","w") as f: + f.write(st) + + subprocess.run(["../../genetIC", "paramfile_anim.txt"]) + +for frame in range(100): + size = frame/5 + run_genetic(size) + p.clf() + ps.plotslice("./") + p.savefig("anim/%.3d.png"%frame) + ps.plotslice("./",diff_prefix="comp/",diff_normalized=False) + p.savefig("anim_diff/%.3d.png"%frame) diff --git a/genetIC/tests/test_24b_splicing_potential/paramfile.txt b/genetIC/tests/test_24b_splicing_potential/paramfile.txt new file mode 100644 index 00000000..247c5c6e --- /dev/null +++ b/genetIC/tests/test_24b_splicing_potential/paramfile.txt @@ -0,0 +1,31 @@ +# Test splicing of two different random fields + +Om 0.279 +Ol 0.721 +#Ob 0.04 +s8 0.817 +zin 99 + +random_seed 8896131 +camb ../camb_transfer_kmax40_z0.dat + +outname test_24b +outdir ./ +outformat tipsy + + +basegrid 50.0 16 + +center 25 25 25 +select_sphere 10 + + +set_splice_minimization MINRES +splice_seedfourier_parallel +set_splice_accuracy relative 1e-5 +splice_potential 8896132 + +done + +dump_ps 0 +dump_grid 0 diff --git a/genetIC/tests/test_24b_splicing_potential/reference_grid/grid-0.npy b/genetIC/tests/test_24b_splicing_potential/reference_grid/grid-0.npy new file mode 100644 index 00000000..47261d10 Binary files /dev/null and b/genetIC/tests/test_24b_splicing_potential/reference_grid/grid-0.npy differ diff --git a/genetIC/tests/test_24b_splicing_potential/reference_grid/grid-info-0.txt b/genetIC/tests/test_24b_splicing_potential/reference_grid/grid-info-0.txt new file mode 100644 index 00000000..afded698 --- /dev/null +++ b/genetIC/tests/test_24b_splicing_potential/reference_grid/grid-info-0.txt @@ -0,0 +1,3 @@ +0 0 0 50 +The line above contains information about grid level 0 +It gives the x-offset, y-offset and z-offset of the low-left corner and also the box length diff --git a/genetIC/tests/test_24b_splicing_potential/reference_output b/genetIC/tests/test_24b_splicing_potential/reference_output new file mode 100644 index 00000000..b8ca0903 Binary files /dev/null and b/genetIC/tests/test_24b_splicing_potential/reference_output differ