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
ebb5d65a
Commit
ebb5d65a
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Impose a mininum r/H in the softened gravity derivatives for M2P and M2L
parent
edf1eb93
No related branches found
No related tags found
1 merge request
!1077
Improved multipole acceptance criterion (MAC)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gravity_derivatives.h
+4
-14
4 additions, 14 deletions
src/gravity_derivatives.h
with
4 additions
and
14 deletions
src/gravity_derivatives.h
+
4
−
14
View file @
ebb5d65a
...
@@ -220,11 +220,6 @@ potential_derivatives_compute_M2L(const float r_x, const float r_y,
...
@@ -220,11 +220,6 @@ potential_derivatives_compute_M2L(const float r_x, const float r_y,
const
int
periodic
,
const
float
r_s_inv
,
const
int
periodic
,
const
float
r_s_inv
,
struct
potential_derivatives_M2L
*
pot
)
{
struct
potential_derivatives_M2L
*
pot
)
{
#ifdef SWIFT_DEBUG_CHECKS
// if (r2 < 0.99f * eps * eps)
// error("Computing M2L derivatives below softening length");
#endif
float
Dt_1
;
float
Dt_1
;
#if SELF_GRAVITY_MULTIPOLE_ORDER > 0
#if SELF_GRAVITY_MULTIPOLE_ORDER > 0
float
Dt_3
;
float
Dt_3
;
...
@@ -247,8 +242,8 @@ potential_derivatives_compute_M2L(const float r_x, const float r_y,
...
@@ -247,8 +242,8 @@ potential_derivatives_compute_M2L(const float r_x, const float r_y,
const
float
eps_inv
=
1
.
f
/
eps
;
const
float
eps_inv
=
1
.
f
/
eps
;
const
float
r
=
r2
*
r_inv
;
const
float
r
=
r2
*
r_inv
;
const
float
u
=
r
*
eps_inv
;
const
float
u
=
max
(
r
*
eps_inv
,
0
.
01
f
)
;
const
float
u_inv
=
r_inv
*
eps
;
const
float
u_inv
=
min
(
r_inv
*
eps
,
100
.
f
)
;
Dt_1
=
-
eps_inv
*
D_soft_1
(
u
,
u_inv
);
Dt_1
=
-
eps_inv
*
D_soft_1
(
u
,
u_inv
);
#if SELF_GRAVITY_MULTIPOLE_ORDER > 0
#if SELF_GRAVITY_MULTIPOLE_ORDER > 0
...
@@ -484,11 +479,6 @@ potential_derivatives_compute_M2P(const float r_x, const float r_y,
...
@@ -484,11 +479,6 @@ potential_derivatives_compute_M2P(const float r_x, const float r_y,
const
int
periodic
,
const
float
r_s_inv
,
const
int
periodic
,
const
float
r_s_inv
,
struct
potential_derivatives_M2P
*
pot
)
{
struct
potential_derivatives_M2P
*
pot
)
{
#ifdef SWIFT_DEBUG_CHECKS
// if (r2 < 0.99f * eps * eps)
// error("Computing M2P derivatives below softening length");
#endif
float
Dt_1
;
float
Dt_1
;
float
Dt_3
;
float
Dt_3
;
#if SELF_GRAVITY_MULTIPOLE_ORDER > 0
#if SELF_GRAVITY_MULTIPOLE_ORDER > 0
...
@@ -509,8 +499,8 @@ potential_derivatives_compute_M2P(const float r_x, const float r_y,
...
@@ -509,8 +499,8 @@ potential_derivatives_compute_M2P(const float r_x, const float r_y,
const
float
eps_inv
=
1
.
f
/
eps
;
const
float
eps_inv
=
1
.
f
/
eps
;
const
float
r
=
r2
*
r_inv
;
const
float
r
=
r2
*
r_inv
;
const
float
u
=
r
*
eps_inv
;
const
float
u
=
max
(
r
*
eps_inv
,
0
.
01
f
)
;
const
float
u_inv
=
r_inv
*
eps
;
const
float
u_inv
=
min
(
r_inv
*
eps
,
100
.
f
)
;
Dt_1
=
-
eps_inv
*
D_soft_1
(
u
,
u_inv
);
Dt_1
=
-
eps_inv
*
D_soft_1
(
u
,
u_inv
);
const
float
eps_inv2
=
eps_inv
*
eps_inv
;
const
float
eps_inv2
=
eps_inv
*
eps_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