Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
53bc63dc
Commit
53bc63dc
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Better name for temporary variable
parent
3348cd78
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!136
Master
,
!127
Save a sqrtf() call per particle in drift task
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner.c
+6
-6
6 additions, 6 deletions
src/runner.c
with
6 additions
and
6 deletions
src/runner.c
+
6
−
6
View file @
53bc63dc
...
...
@@ -664,7 +664,7 @@ void runner_dodrift(struct runner *r, struct cell *c, int timer) {
const
float
ti_current
=
r
->
e
->
ti_current
;
struct
part
*
restrict
p
,
*
restrict
parts
=
c
->
parts
;
struct
xpart
*
restrict
xp
,
*
restrict
xparts
=
c
->
xparts
;
float
dx_max
=
0
.
f
,
h_max
=
0
.
f
;
float
dx_max
=
0
.
f
,
dx2_max
=
0
.
f
,
h_max
=
0
.
f
;
float
w
;
TIMER_TIC
...
...
@@ -710,17 +710,17 @@ void runner_dodrift(struct runner *r, struct cell *c, int timer) {
hydro_predict_extra
(
p
,
xp
,
ti_old
,
ti_current
,
timeBase
);
/* Compute (square of) motion since last cell construction */
const
float
dx
=
(
p
->
x
[
0
]
-
xp
->
x_old
[
0
])
*
(
p
->
x
[
0
]
-
xp
->
x_old
[
0
])
+
(
p
->
x
[
1
]
-
xp
->
x_old
[
1
])
*
(
p
->
x
[
1
]
-
xp
->
x_old
[
1
])
+
(
p
->
x
[
2
]
-
xp
->
x_old
[
2
])
*
(
p
->
x
[
2
]
-
xp
->
x_old
[
2
]);
dx_max
=
fmaxf
(
dx_max
,
dx
);
const
float
dx
2
=
(
p
->
x
[
0
]
-
xp
->
x_old
[
0
])
*
(
p
->
x
[
0
]
-
xp
->
x_old
[
0
])
+
(
p
->
x
[
1
]
-
xp
->
x_old
[
1
])
*
(
p
->
x
[
1
]
-
xp
->
x_old
[
1
])
+
(
p
->
x
[
2
]
-
xp
->
x_old
[
2
])
*
(
p
->
x
[
2
]
-
xp
->
x_old
[
2
]);
dx
2
_max
=
fmaxf
(
dx
2
_max
,
dx
2
);
/* Maximal smoothing length */
h_max
=
fmaxf
(
p
->
h
,
h_max
);
}
/* Now, get the maximal particle motion from its square */
dx_max
=
sqrtf
(
dx_max
);
dx_max
=
sqrtf
(
dx
2
_max
);
}
/* Otherwise, aggregate data from children. */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment