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
7c9293d2
Commit
7c9293d2
authored
Mar 10, 2016
by
Matthieu Schaller
Browse files
space_do_split() now also checks the gparts timestep not just the parts
parent
20ae3842
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/space.c
View file @
7c9293d2
...
...
@@ -1006,11 +1006,11 @@ void space_do_split(struct space *s, struct cell *c) {
const
int
count
=
c
->
count
;
const
int
gcount
=
c
->
gcount
;
int
maxdepth
=
0
;
float
h
,
h_max
=
0
.
0
f
;
int
ti_end_min
=
max_nr_timesteps
,
ti_end_max
=
0
,
ti_end
;
float
h_max
=
0
.
0
f
;
int
ti_end_min
=
max_nr_timesteps
,
ti_end_max
=
0
;
struct
cell
*
temp
;
struct
part
*
p
,
*
parts
=
c
->
parts
;
struct
x
part
*
xp
,
*
x
parts
=
c
->
x
parts
;
struct
part
*
parts
=
c
->
parts
;
struct
g
part
*
g
parts
=
c
->
g
parts
;
/* Check the depth. */
if
(
c
->
depth
>
s
->
maxdepth
)
s
->
maxdepth
=
c
->
depth
;
...
...
@@ -1080,17 +1080,19 @@ void space_do_split(struct space *s, struct cell *c) {
/* Get dt_min/dt_max. */
for
(
int
k
=
0
;
k
<
count
;
k
++
)
{
p
=
&
parts
[
k
];
xp
=
&
xparts
[
k
];
xp
->
x_old
[
0
]
=
p
->
x
[
0
];
xp
->
x_old
[
1
]
=
p
->
x
[
1
];
xp
->
x_old
[
2
]
=
p
->
x
[
2
];
h
=
p
->
h
;
ti_end
=
p
->
ti_end
;
struct
part
*
p
=
&
parts
[
k
];
const
float
h
=
p
->
h
;
const
int
ti_end
=
p
->
ti_end
;
if
(
h
>
h_max
)
h_max
=
h
;
if
(
ti_end
<
ti_end_min
)
ti_end_min
=
ti_end
;
if
(
ti_end
>
ti_end_max
)
ti_end_max
=
ti_end
;
}
for
(
int
k
=
0
;
k
<
gcount
;
k
++
)
{
struct
gpart
*
p
=
&
gparts
[
k
];
const
int
ti_end
=
p
->
ti_end
;
if
(
ti_end
<
ti_end_min
)
ti_end_min
=
ti_end
;
if
(
ti_end
>
ti_end_max
)
ti_end_max
=
ti_end
;
}
c
->
h_max
=
h_max
;
c
->
ti_end_min
=
ti_end_min
;
c
->
ti_end_max
=
ti_end_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