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
59c8e5d0
Commit
59c8e5d0
authored
Apr 17, 2017
by
Matthieu Schaller
Browse files
Do things in double precision for now.
parent
a21e6959
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/space.c
View file @
59c8e5d0
...
...
@@ -2095,11 +2095,11 @@ void space_split_recursive(struct space *s, struct cell *c,
gravity_multipole_add
(
&
c
->
multipole
->
m_pole
,
&
temp
);
/* Upper limit of max CoM<->gpart distance */
const
float
dx
=
c
->
multipole
->
CoM
[
0
]
-
cp
->
multipole
->
CoM
[
0
];
const
float
dy
=
c
->
multipole
->
CoM
[
1
]
-
cp
->
multipole
->
CoM
[
1
];
const
float
dz
=
c
->
multipole
->
CoM
[
2
]
-
cp
->
multipole
->
CoM
[
2
];
const
float
r2
=
dx
*
dx
+
dy
*
dy
+
dz
*
dz
;
r_max
=
max
(
r_max
,
cp
->
multipole
->
r_max
+
sqrt
f
(
r2
));
const
double
dx
=
c
->
multipole
->
CoM
[
0
]
-
cp
->
multipole
->
CoM
[
0
];
const
double
dy
=
c
->
multipole
->
CoM
[
1
]
-
cp
->
multipole
->
CoM
[
1
];
const
double
dz
=
c
->
multipole
->
CoM
[
2
]
-
cp
->
multipole
->
CoM
[
2
];
const
double
r2
=
dx
*
dx
+
dy
*
dy
+
dz
*
dz
;
r_max
=
max
(
r_max
,
cp
->
multipole
->
r_max
+
sqrt
(
r2
));
}
}
/* Alternative upper limit of max CoM<->gpart distance */
...
...
@@ -2115,7 +2115,7 @@ void space_split_recursive(struct space *s, struct cell *c,
/* Take minimum of both limits */
c
->
multipole
->
r_max
=
min
(
r_max
,
sqrt
(
dx
*
dx
+
dy
*
dy
+
dz
*
dz
));
}
}
/* Deal with gravity */
}
/* Otherwise, collect the data for this cell. */
...
...
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