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
8f4f81dc
Commit
8f4f81dc
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Fixed FPE problem due to vectorization of the FFT task.
parent
1415cbc1
No related branches found
No related tags found
1 merge request
!430
Fixes to the gravity code
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/kernel_long_gravity.h
+1
-1
1 addition, 1 deletion
src/kernel_long_gravity.h
src/runner_doiact_fft.c
+2
-2
2 additions, 2 deletions
src/runner_doiact_fft.c
with
3 additions
and
3 deletions
src/kernel_long_gravity.h
+
1
−
1
View file @
8f4f81dc
...
...
@@ -78,7 +78,7 @@ __attribute__((always_inline)) INLINE static void fourier_kernel_long_grav_eval(
#else
const
double
u
=
sqrt
(
u2
);
const
double
arg
=
M_PI_2
*
u
;
*
W
=
arg
/
sinh
(
arg
);
*
W
=
arg
/
(
sinh
(
arg
)
+
FLT_MIN
)
;
#endif
}
...
...
This diff is collapsed.
Click to expand it.
src/runner_doiact_fft.c
+
2
−
2
View file @
8f4f81dc
...
...
@@ -231,7 +231,7 @@ void runner_do_grav_fft(struct runner* r, int timer) {
const
int
kz
=
(
k
>
N_half
?
k
-
N
:
k
);
const
double
kz_d
=
(
double
)
kz
;
const
double
fz
=
k_fac
*
kz_d
;
const
double
sinc_kz_inv
=
(
kz
!=
0
)
?
fz
/
sin
(
fz
)
:
1
.;
const
double
sinc_kz_inv
=
(
kz
!=
0
)
?
fz
/
(
sin
(
fz
)
+
FLT_MIN
)
:
1
.;
/* Norm of vector in Fourier space */
const
double
k2
=
(
kx_d
*
kx_d
+
ky_d
*
ky_d
+
kz_d
*
kz_d
);
...
...
@@ -242,7 +242,7 @@ void runner_do_grav_fft(struct runner* r, int timer) {
/* Green function */
double
W
;
fourier_kernel_long_grav_eval
(
k2
*
a_smooth2
,
&
W
);
const
double
green_cor
=
green_fac
*
W
/
k2
;
const
double
green_cor
=
green_fac
*
W
/
(
k2
+
FLT_MIN
)
;
/* Deconvolution of CIC */
const
double
CIC_cor
=
sinc_kx_inv
*
sinc_ky_inv
*
sinc_kz_inv
;
...
...
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