Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
d5f913b8
Commit
d5f913b8
authored
Aug 14, 2016
by
Matthieu Schaller
Browse files
Merge branch 'master' of gitlab.cosma.dur.ac.uk:swift/swiftsim
parents
b8e7f90a
42fe194b
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/difffloat.py
View file @
d5f913b8
...
...
@@ -89,13 +89,12 @@ for i in range(n_lines_to_check):
abs_diff
=
abs
(
data1
[
i
,
j
]
-
data2
[
i
,
j
])
sum
=
abs
(
data1
[
i
,
j
]
+
data2
[
i
,
j
])
if
abs
(
data1
[
i
,
j
])
+
abs
(
data2
[
i
,
j
])
<
2.5e-7
:
continue
if
sum
>
0
:
rel_diff
=
abs
(
data1
[
i
,
j
]
-
data2
[
i
,
j
])
/
sum
else
:
rel_diff
=
0.
if
(
abs_diff
>
absTol
[
j
]):
if
(
abs_diff
>
1.1
*
absTol
[
j
]):
print
"Absolute difference larger than tolerance (%e) for particle %d, column %d:"
%
(
absTol
[
j
],
i
,
j
)
print
"%10s: a = %e"
%
(
"File 1"
,
data1
[
i
,
j
])
print
"%10s: b = %e"
%
(
"File 2"
,
data2
[
i
,
j
])
...
...
@@ -103,7 +102,9 @@ for i in range(n_lines_to_check):
print
""
error
=
True
if
(
rel_diff
>
relTol
[
j
]):
if
abs
(
data1
[
i
,
j
])
<
1e-6
and
+
abs
(
data2
[
i
,
j
])
<
1e-6
:
continue
if
(
rel_diff
>
1.1
*
relTol
[
j
]):
print
"Relative difference larger than tolerance (%e) for particle %d, column %d:"
%
(
relTol
[
j
],
i
,
j
)
print
"%10s: a = %e"
%
(
"File 1"
,
data1
[
i
,
j
])
print
"%10s: b = %e"
%
(
"File 2"
,
data2
[
i
,
j
])
...
...
tests/test125cells.c
View file @
d5f913b8
...
...
@@ -472,8 +472,8 @@ int main(int argc, char *argv[]) {
prog_const
.
const_newton_G
=
1
.
f
;
struct
hydro_props
hp
;
hp
.
target_neighbours
=
h
*
h
*
h
*
kernel_norm
;
hp
.
delta_neighbours
=
1
.;
hp
.
target_neighbours
=
pow_dimension
(
h
)
*
kernel_norm
;
hp
.
delta_neighbours
=
2
.;
hp
.
max_smoothing_iterations
=
1
;
hp
.
CFL_condition
=
0
.
1
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment