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
70edbfe7
Commit
70edbfe7
authored
Oct 20, 2015
by
Matthieu Schaller
Browse files
Converted space.c
parent
8b49a37d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/space.c
View file @
70edbfe7
...
...
@@ -902,7 +902,7 @@ void space_map_cells_pre(struct space *s, int full,
void
space_split
(
struct
space
*
s
,
struct
cell
*
c
)
{
int
k
,
count
=
c
->
count
,
gcount
=
c
->
gcount
,
maxdepth
=
0
;
float
h
,
h_max
=
0
.
0
f
,
dt
,
dt
_min
=
c
->
parts
[
0
].
dt
,
dt_max
=
dt_min
;
float
h
,
h_max
=
0
.
0
f
,
t_end
_min
=
FLT_MAX
,
t_end_max
=
0
.,
t_end
;
struct
cell
*
temp
;
struct
part
*
p
,
*
parts
=
c
->
parts
;
struct
xpart
*
xp
,
*
xparts
=
c
->
xparts
;
...
...
@@ -951,16 +951,16 @@ void space_split(struct space *s, struct cell *c) {
}
else
{
space_split
(
s
,
c
->
progeny
[
k
]);
h_max
=
fmaxf
(
h_max
,
c
->
progeny
[
k
]
->
h_max
);
d
t_min
=
fminf
(
d
t_min
,
c
->
progeny
[
k
]
->
d
t_min
);
d
t_max
=
fmaxf
(
d
t_max
,
c
->
progeny
[
k
]
->
d
t_max
);
t
_end
_min
=
fminf
(
t
_end
_min
,
c
->
progeny
[
k
]
->
t
_end
_min
);
t
_end
_max
=
fmaxf
(
t
_end
_max
,
c
->
progeny
[
k
]
->
t
_end
_max
);
if
(
c
->
progeny
[
k
]
->
maxdepth
>
maxdepth
)
maxdepth
=
c
->
progeny
[
k
]
->
maxdepth
;
}
/* Set the values for this cell. */
c
->
h_max
=
h_max
;
c
->
d
t_min
=
d
t_min
;
c
->
d
t_max
=
d
t_max
;
c
->
t
_end
_min
=
t
_end
_min
;
c
->
t
_end
_max
=
t
_end
_max
;
c
->
maxdepth
=
maxdepth
;
}
...
...
@@ -981,15 +981,14 @@ void space_split(struct space *s, struct cell *c) {
xp
->
x_old
[
0
]
=
p
->
x
[
0
];
xp
->
x_old
[
1
]
=
p
->
x
[
1
];
xp
->
x_old
[
2
]
=
p
->
x
[
2
];
dt
=
p
->
dt
;
h
=
p
->
h
;
if
(
h
>
h_max
)
h_max
=
h
;
if
(
dt
<
dt
_min
)
d
t_min
=
d
t
;
if
(
dt
>
dt
_max
)
d
t_max
=
d
t
;
if
(
t_end
<
t_end
_min
)
t
_end
_min
=
t
_end
;
if
(
t_end
>
t_end
_max
)
t
_end
_max
=
t
_end
;
}
c
->
h_max
=
h_max
;
c
->
d
t_min
=
d
t_min
;
c
->
d
t_max
=
d
t_max
;
c
->
t
_end
_min
=
t
_end
_min
;
c
->
t
_end
_max
=
t
_end
_max
;
}
/* Set ownership accorind to the start of the parts array. */
...
...
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