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
fda78037
Commit
fda78037
authored
Mar 24, 2016
by
Tom Theuns
Browse files
Now compiles and runs
parent
853cd4b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
examples/main.c
View file @
fda78037
...
...
@@ -475,7 +475,7 @@ int main(int argc, char *argv[]) {
message
(
"%zi parts in %i cells."
,
s
.
nr_parts
,
s
.
tot_cells
);
message
(
"%zi gparts in %i cells."
,
s
.
nr_gparts
,
s
.
tot_cells
);
message
(
"maximum depth is %d."
,
s
.
maxdepth
);
message
(
"gparts[10].id = %ld."
,
gparts
[
10
].
id
);
message
(
"gparts[10].id = %
l
ld."
,
gparts
[
10
].
id
);
// message( "cutoffs in [ %g %g ]." , s.h_min , s.h_max ); fflush(stdout);
}
...
...
src/gravity/ExternalPotential/gravity_part.h
View file @
fda78037
...
...
@@ -63,7 +63,7 @@ struct gpart {
union
{
/* Particle ID. By default: gravity only particles have a negative ID*/
long
id
;
long
long
id
;
/* Pointer to corresponding SPH part. */
struct
part
*
part
;
...
...
src/runner.c
View file @
fda78037
...
...
@@ -142,7 +142,7 @@ void runner_dograv_external(struct runner *r, struct cell *c) {
L
[
0
]
=
dy
*
g
->
v_full
[
2
]
-
dz
*
g
->
v_full
[
1
];
L
[
1
]
=
dz
*
g
->
v_full
[
0
]
-
dx
*
g
->
v_full
[
2
];
L
[
2
]
=
dx
*
g
->
v_full
[
1
]
-
dy
*
g
->
v_full
[
0
];
if
(
g
->
id
==
0
)
{
if
(
abs
(
g
->
id
)
==
1
)
{
float
v2
=
g
->
v_full
[
0
]
*
g
->
v_full
[
0
]
+
g
->
v_full
[
1
]
*
g
->
v_full
[
1
]
+
g
->
v_full
[
2
]
*
g
->
v_full
[
2
];
float
fg
=
const_G
*
External_Potential_Mass
*
rinv
;
//message("grav_external time= %f\t V_c^2= %f GM/r= %f E= %f L[2]= %f x= %f y= %f vx= %f vy= %f\n", r->e->time, v2, fg, E, L[2], g->x[0], g->x[1], g->v_full[0], g->v_full[1]);
...
...
src/space.c
View file @
fda78037
...
...
@@ -164,11 +164,11 @@ void space_regrid(struct space *s, double cell_max, int verbose) {
// tic = getticks();
if
(
nr_parts
)
{
if
(
s
->
cells
!=
NULL
)
{
for
(
k
=
0
;
k
<
s
->
nr_cells
;
k
++
)
{
for
(
int
k
=
0
;
k
<
s
->
nr_cells
;
k
++
)
{
if
(
s
->
cells
[
k
].
h_max
>
h_max
)
h_max
=
s
->
cells
[
k
].
h_max
;
}
}
else
{
for
(
k
=
0
;
k
<
nr_parts
;
k
++
)
{
for
(
int
k
=
0
;
k
<
nr_parts
;
k
++
)
{
if
(
s
->
parts
[
k
].
h
>
h_max
)
h_max
=
s
->
parts
[
k
].
h
;
}
s
->
h_max
=
h_max
;
...
...
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