Skip to content
GitLab
Menu
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
810ce3ba
Commit
810ce3ba
authored
Jan 22, 2013
by
Pedro Gonnet
Browse files
fix how we look for sub-cell in dosub_subset, i.e. with pointers not location.
Former-commit-id: 190cd1b9cae99df960026932f991a7bb039cad7b
parent
0a34510d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
810ce3ba
...
...
@@ -208,16 +208,16 @@ void engine_step ( struct engine *e , int sort_queues ) {
u_bar
[
k
]
=
p
->
u
+
hdt
*
p
->
u_dt
;
/* Move the particles with the velocitie at the half-step. */
//
p->x[0] += dt * v_bar[3*k+0];
//
p->x[1] += dt * v_bar[3*k+1];
//
p->x[2] += dt * v_bar[3*k+2];
p
->
x
[
0
]
+=
dt
*
v_bar
[
3
*
k
+
0
];
p
->
x
[
1
]
+=
dt
*
v_bar
[
3
*
k
+
1
];
p
->
x
[
2
]
+=
dt
*
v_bar
[
3
*
k
+
2
];
/* Update positions and energies at the half-step. */
p
->
v
[
0
]
+=
dt
*
p
->
a
[
0
];
p
->
v
[
1
]
+=
dt
*
p
->
a
[
1
];
p
->
v
[
2
]
+=
dt
*
p
->
a
[
2
];
//
p->u *= expf( p->u_dt / p->u * dt );
//
p->h *= expf( -1.0f * p->h_dt / p->h * dt );
p
->
u
*=
expf
(
p
->
u_dt
/
p
->
u
*
dt
);
p
->
h
*=
expf
(
-
1
.
0
f
*
p
->
h_dt
/
p
->
h
*
dt
);
/* Integrate other values if this particle will not be updated. */
if
(
p
->
dt
>
dt_max
)
{
...
...
src/runner_doiact.h
View file @
810ce3ba
...
...
@@ -2053,12 +2053,14 @@ void DOSUB_SUBSET ( struct runner *r , struct cell *restrict ci , struct part *p
/* Find out in which sub-cell of ci the parts are. */
for
(
k
=
0
;
k
<
8
;
k
++
)
if
(
ci
->
progeny
[
k
]
!=
NULL
)
{
if
(
parts
[
ind
[
0
]
].
x
[
0
]
>=
ci
->
progeny
[
k
]
->
loc
[
0
]
&&
parts
[
ind
[
0
]
].
x
[
0
]
<=
ci
->
progeny
[
k
]
->
loc
[
0
]
+
ci
->
progeny
[
k
]
->
h
[
0
]
&&
parts
[
ind
[
0
]
].
x
[
1
]
>=
ci
->
progeny
[
k
]
->
loc
[
1
]
&&
parts
[
ind
[
0
]
].
x
[
1
]
<=
ci
->
progeny
[
k
]
->
loc
[
1
]
+
ci
->
progeny
[
k
]
->
h
[
1
]
&&
parts
[
ind
[
0
]
].
x
[
2
]
>=
ci
->
progeny
[
k
]
->
loc
[
2
]
&&
parts
[
ind
[
0
]
].
x
[
2
]
<=
ci
->
progeny
[
k
]
->
loc
[
2
]
+
ci
->
progeny
[
k
]
->
h
[
2
]
)
{
// if ( parts[ ind[ 0 ] ].x[0] >= ci->progeny[k]->loc[0] &&
// parts[ ind[ 0 ] ].x[0] <= ci->progeny[k]->loc[0] + ci->progeny[k]->h[0] &&
// parts[ ind[ 0 ] ].x[1] >= ci->progeny[k]->loc[1] &&
// parts[ ind[ 0 ] ].x[1] <= ci->progeny[k]->loc[1] + ci->progeny[k]->h[1] &&
// parts[ ind[ 0 ] ].x[2] >= ci->progeny[k]->loc[2] &&
// parts[ ind[ 0 ] ].x[2] <= ci->progeny[k]->loc[2] + ci->progeny[k]->h[2] ) {
if
(
&
parts
[
ind
[
0
]
]
>=
&
ci
->
progeny
[
k
]
->
parts
[
0
]
&&
&
parts
[
ind
[
0
]
]
<
&
ci
->
progeny
[
k
]
->
parts
[
ci
->
progeny
[
k
]
->
count
]
)
{
sub
=
ci
->
progeny
[
k
];
break
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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