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
ed3a32d3
Commit
ed3a32d3
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Do not use the approximate erf in the long-range truncation functions
parent
4f82cd78
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1077
Improved multipole acceptance criterion (MAC)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/kernel_long_gravity.h
+3
-3
3 additions, 3 deletions
src/kernel_long_gravity.h
with
3 additions
and
3 deletions
src/kernel_long_gravity.h
+
3
−
3
View file @
ed3a32d3
...
...
@@ -91,7 +91,7 @@ kernel_long_grav_derivatives(const float r, const float r_s_inv,
const
float
r_s_inv5
=
r_s_inv4
*
r_s_inv
;
/* Derivatives of \chi */
derivs
->
chi_0
=
approx_
erfcf
(
u
);
derivs
->
chi_0
=
erfcf
(
u
);
derivs
->
chi_1
=
-
r_s_inv
;
derivs
->
chi_2
=
r_s_inv2
*
u
;
derivs
->
chi_3
=
-
r_s_inv3
*
(
u2
-
0
.
5
f
);
...
...
@@ -158,7 +158,7 @@ __attribute__((const)) INLINE static float kernel_long_grav_pot_eval(
#ifdef GADGET2_LONG_RANGE_CORRECTION
const
float
arg1
=
u
*
0
.
5
f
;
return
approx_
erfcf
(
arg1
);
return
erfcf
(
arg1
);
#else
...
...
@@ -190,7 +190,7 @@ __attribute__((const)) INLINE static float kernel_long_grav_force_eval(
const
float
arg1
=
u
*
0
.
5
f
;
const
float
arg2
=
-
arg1
*
arg1
;
const
float
term1
=
approx_
erfcf
(
arg1
);
const
float
term1
=
erfcf
(
arg1
);
const
float
term2
=
u
*
one_over_sqrt_pi
*
expf
(
arg2
);
return
term1
+
term2
;
...
...
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