Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
c07c1b30
Commit
c07c1b30
authored
4 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Small fixes to the neutrino unit test
parent
dd95b304
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
tests/Makefile.am
+2
-1
2 additions, 1 deletion
tests/Makefile.am
tests/testNeutrinoCosmology.c
+3
-1
3 additions, 1 deletion
tests/testNeutrinoCosmology.c
with
6 additions
and
2 deletions
.gitignore
+
1
−
0
View file @
c07c1b30
...
...
@@ -171,6 +171,7 @@ tests/testFormat.sh
tests/testCooling
tests/testComovingCooling
tests/testHashmap
tests/testNeutrinoCosmology
tests/*.png
tests/*.txt
...
...
This diff is collapsed.
Click to expand it.
tests/Makefile.am
+
2
−
1
View file @
c07c1b30
...
...
@@ -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_scale_factor.txt testEOS.sh testEOS_plot.sh
\
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
This diff is collapsed.
Click to expand it.
tests/testNeutrinoCosmology.c
+
3
−
1
View file @
c07c1b30
...
...
@@ -104,6 +104,7 @@ int main(int argc, char *argv[]) {
const
int
cols
=
3
;
double
CLASS_table
[
rows
*
cols
];
FILE
*
stream
=
fopen
(
"testNeutrinoCosmology.dat"
,
"r"
);
if
(
stream
==
NULL
)
error
(
"Could not open reference solution file!"
);
char
line
[
1024
];
int
row
=
0
;
while
(
fgets
(
line
,
1024
,
stream
))
{
...
...
@@ -182,7 +183,8 @@ int main(int argc, char *argv[]) {
double
time2
=
CLASS_table
[
1
+
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
;
assert
(
fabs
(
a1
-
a2
)
/
(
a1
+
a2
)
<
EXTERNAL_TOLERANCE
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment