Skip to content
Snippets Groups Projects
Commit c07c1b30 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Small fixes to the neutrino unit test

parent dd95b304
No related branches found
No related tags found
No related merge requests found
...@@ -171,6 +171,7 @@ tests/testFormat.sh ...@@ -171,6 +171,7 @@ tests/testFormat.sh
tests/testCooling tests/testCooling
tests/testComovingCooling tests/testComovingCooling
tests/testHashmap tests/testHashmap
tests/testNeutrinoCosmology
tests/*.png tests/*.png
tests/*.txt tests/*.txt
......
...@@ -162,4 +162,5 @@ EXTRA_DIST = testReading.sh makeInput.py testActivePair.sh \ ...@@ -162,4 +162,5 @@ EXTRA_DIST = testReading.sh makeInput.py testActivePair.sh \
output_list_params.yml output_list_time.txt output_list_redshift.txt \ output_list_params.yml output_list_time.txt output_list_redshift.txt \
output_list_scale_factor.txt testEOS.sh testEOS_plot.sh \ output_list_scale_factor.txt testEOS.sh testEOS_plot.sh \
test27cellsStars.sh test27cellsStarsPerturbed.sh star_tolerance_27_normal.dat \ test27cellsStars.sh test27cellsStarsPerturbed.sh star_tolerance_27_normal.dat \
star_tolerance_27_perturbed.dat star_tolerance_27_perturbed_h.dat star_tolerance_27_perturbed_h2.dat star_tolerance_27_perturbed.dat star_tolerance_27_perturbed_h.dat star_tolerance_27_perturbed_h2.dat \
testNeutrinoCosmology.dat
...@@ -104,6 +104,7 @@ int main(int argc, char *argv[]) { ...@@ -104,6 +104,7 @@ int main(int argc, char *argv[]) {
const int cols = 3; const int cols = 3;
double CLASS_table[rows * cols]; double CLASS_table[rows * cols];
FILE *stream = fopen("testNeutrinoCosmology.dat", "r"); FILE *stream = fopen("testNeutrinoCosmology.dat", "r");
if (stream == NULL) error("Could not open reference solution file!");
char line[1024]; char line[1024];
int row = 0; int row = 0;
while (fgets(line, 1024, stream)) { while (fgets(line, 1024, stream)) {
...@@ -182,7 +183,8 @@ int main(int argc, char *argv[]) { ...@@ -182,7 +183,8 @@ int main(int argc, char *argv[]) {
double time2 = CLASS_table[1 + 3 * j]; double time2 = CLASS_table[1 + 3 * j];
double Onu2 = CLASS_table[2 + 3 * j]; double Onu2 = CLASS_table[2 + 3 * j];
/* Class defines years as 365.25 days, we use 365 days. */ /* Class defines years as 365.25 days, we use 365 days (in this test).
*/
time2 *= 365.25 / 365.0; time2 *= 365.25 / 365.0;
assert(fabs(a1 - a2) / (a1 + a2) < EXTERNAL_TOLERANCE); assert(fabs(a1 - a2) / (a1 + a2) < EXTERNAL_TOLERANCE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment