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
aa9d7e13
Commit
aa9d7e13
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Use the correct multipole order in the gravity derivatives unit test.
parent
71ff1f7e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!914
Improvements to the particle-multipole interactions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/testGravityDerivatives.c
+11
-8
11 additions, 8 deletions
tests/testGravityDerivatives.c
with
11 additions
and
8 deletions
tests/testGravityDerivatives.c
+
11
−
8
View file @
aa9d7e13
...
@@ -959,6 +959,7 @@ int main(int argc, char* argv[]) {
...
@@ -959,6 +959,7 @@ int main(int argc, char* argv[]) {
/* Compute all derivatives */
/* Compute all derivatives */
struct
potential_derivatives_M2L
pot
;
struct
potential_derivatives_M2L
pot
;
bzero
(
&
pot
,
sizeof
(
struct
potential_derivatives_M2L
));
potential_derivatives_compute_M2L
(
dx
,
dy
,
dz
,
r2
,
r_inv
,
eps
,
periodic
,
potential_derivatives_compute_M2L
(
dx
,
dy
,
dz
,
r2
,
r_inv
,
eps
,
periodic
,
r_s_inv
,
&
pot
);
r_s_inv
,
&
pot
);
...
@@ -1077,25 +1078,27 @@ int main(int argc, char* argv[]) {
...
@@ -1077,25 +1078,27 @@ int main(int argc, char* argv[]) {
/* Compute all derivatives */
/* Compute all derivatives */
struct
potential_derivatives_M2P
pot
;
struct
potential_derivatives_M2P
pot
;
bzero
(
&
pot
,
sizeof
(
struct
potential_derivatives_M2P
));
potential_derivatives_compute_M2P
(
dx
,
dy
,
dz
,
r2
,
r_inv
,
eps
,
periodic
,
potential_derivatives_compute_M2P
(
dx
,
dy
,
dz
,
r2
,
r_inv
,
eps
,
periodic
,
r_s_inv
,
&
pot
);
r_s_inv
,
&
pot
);
/* Minimal value we care about */
/* Minimal value we care about */
const
double
min
=
1e-9
;
const
double
min
=
1e-9
;
/* Now check everything... */
/* Now check everything...
*
* Note that the M2P derivatives are computed to order
* SELF_GRAVITY_MULTIPOLE_ORDER + 1 by the function above. */
/* 0th order terms */
/* 0th order terms */
test
(
pot
.
D_000
,
D_000
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_000"
);
test
(
pot
.
D_000
,
D_000
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_000"
);
#if SELF_GRAVITY_MULTIPOLE_ORDER > 0
/* 1st order terms */
/* 1st order terms */
test
(
pot
.
D_100
,
D_100
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_100"
);
test
(
pot
.
D_100
,
D_100
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_100"
);
test
(
pot
.
D_010
,
D_010
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_010"
);
test
(
pot
.
D_010
,
D_010
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_010"
);
test
(
pot
.
D_001
,
D_001
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_001"
);
test
(
pot
.
D_001
,
D_001
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_001"
);
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER >
1
#if SELF_GRAVITY_MULTIPOLE_ORDER >
0
/* 2nd order terms */
/* 2nd order terms */
test
(
pot
.
D_200
,
D_200
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_200"
);
test
(
pot
.
D_200
,
D_200
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_200"
);
...
@@ -1105,7 +1108,7 @@ int main(int argc, char* argv[]) {
...
@@ -1105,7 +1108,7 @@ int main(int argc, char* argv[]) {
test
(
pot
.
D_101
,
D_101
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_101"
);
test
(
pot
.
D_101
,
D_101
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_101"
);
test
(
pot
.
D_011
,
D_011
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_011"
);
test
(
pot
.
D_011
,
D_011
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_011"
);
#endif
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER >
2
#if SELF_GRAVITY_MULTIPOLE_ORDER >
1
tol
*=
2
.
5
;
tol
*=
2
.
5
;
...
@@ -1121,7 +1124,7 @@ int main(int argc, char* argv[]) {
...
@@ -1121,7 +1124,7 @@ int main(int argc, char* argv[]) {
test
(
pot
.
D_012
,
D_012
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_012"
);
test
(
pot
.
D_012
,
D_012
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_012"
);
test
(
pot
.
D_111
,
D_111
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_111"
);
test
(
pot
.
D_111
,
D_111
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_111"
);
#endif
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER >
3
#if SELF_GRAVITY_MULTIPOLE_ORDER >
2
/* 4th order terms */
/* 4th order terms */
test
(
pot
.
D_400
,
D_400
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_400"
);
test
(
pot
.
D_400
,
D_400
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_400"
);
...
@@ -1140,7 +1143,7 @@ int main(int argc, char* argv[]) {
...
@@ -1140,7 +1143,7 @@ int main(int argc, char* argv[]) {
test
(
pot
.
D_121
,
D_121
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_121"
);
test
(
pot
.
D_121
,
D_121
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_121"
);
test
(
pot
.
D_112
,
D_112
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_112"
);
test
(
pot
.
D_112
,
D_112
(
dx
,
dy
,
dz
,
r_inv
),
tol
,
min
,
"M2P D_112"
);
#endif
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER >
4
#if SELF_GRAVITY_MULTIPOLE_ORDER >
3
tol
*=
2
.
5
;
tol
*=
2
.
5
;
...
...
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