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
ec970c94
Commit
ec970c94
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Added guards to force the implementation of higher order terms in *ALL* multipole functions.
parent
bdf837f3
No related branches found
No related tags found
1 merge request
!324
Gravity multi dt
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/multipole.h
+30
-0
30 additions, 0 deletions
src/multipole.h
with
30 additions
and
0 deletions
src/multipole.h
+
30
−
0
View file @
ec970c94
...
@@ -205,6 +205,9 @@ INLINE static void gravity_field_tensors_add(struct gravity_tensors *la,
...
@@ -205,6 +205,9 @@ INLINE static void gravity_field_tensors_add(struct gravity_tensors *la,
la
->
pot
.
F_012
+=
lb
->
pot
.
F_012
;
la
->
pot
.
F_012
+=
lb
->
pot
.
F_012
;
la
->
pot
.
F_111
+=
lb
->
pot
.
F_111
;
la
->
pot
.
F_111
+=
lb
->
pot
.
F_111
;
#endif
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER > 3
#error "Missing implementation for order >3"
#endif
}
}
/**
/**
...
@@ -241,6 +244,10 @@ INLINE static void gravity_field_tensors_print(const struct grav_tensor *l) {
...
@@ -241,6 +244,10 @@ INLINE static void gravity_field_tensors_print(const struct grav_tensor *l) {
printf
(
"F_111= %12.5e
\n
"
,
l
->
F_111
);
printf
(
"F_111= %12.5e
\n
"
,
l
->
F_111
);
#endif
#endif
printf
(
"-------------------------
\n
"
);
printf
(
"-------------------------
\n
"
);
#if SELF_GRAVITY_MULTIPOLE_ORDER > 3
#error "Missing implementation for order >3"
#endif
}
}
/**
/**
...
@@ -278,6 +285,9 @@ INLINE static void gravity_multipole_print(const struct multipole *m) {
...
@@ -278,6 +285,9 @@ INLINE static void gravity_multipole_print(const struct multipole *m) {
printf
(
"M_111= %12.5e
\n
"
,
m
->
M_111
);
printf
(
"M_111= %12.5e
\n
"
,
m
->
M_111
);
#endif
#endif
printf
(
"-------------------------
\n
"
);
printf
(
"-------------------------
\n
"
);
#if SELF_GRAVITY_MULTIPOLE_ORDER > 3
#error "Missing implementation for order >3"
#endif
}
}
/**
/**
...
@@ -499,6 +509,9 @@ INLINE static int gravity_multipole_equal(const struct gravity_tensors *ga,
...
@@ -499,6 +509,9 @@ INLINE static int gravity_multipole_equal(const struct gravity_tensors *ga,
message
(
"M_111 term different"
);
message
(
"M_111 term different"
);
return
0
;
return
0
;
}
}
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER > 3
#error "Missing implementation for order >3"
#endif
#endif
/* All is good */
/* All is good */
...
@@ -628,6 +641,9 @@ INLINE static void gravity_P2M(struct gravity_tensors *m,
...
@@ -628,6 +641,9 @@ INLINE static void gravity_P2M(struct gravity_tensors *m,
m
->
m_pole
.
M_012
=
M_012
;
m
->
m_pole
.
M_012
=
M_012
;
m
->
m_pole
.
M_111
=
M_111
;
m
->
m_pole
.
M_111
=
M_111
;
#endif
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER > 3
#error "Missing implementation for order >3"
#endif
}
}
/**
/**
...
@@ -717,6 +733,10 @@ INLINE static void gravity_M2M(struct multipole *m_a,
...
@@ -717,6 +733,10 @@ INLINE static void gravity_M2M(struct multipole *m_a,
X_101
(
dx
)
*
m_b
->
M_010
+
X_011
(
dx
)
*
m_b
->
M_100
+
X_101
(
dx
)
*
m_b
->
M_010
+
X_011
(
dx
)
*
m_b
->
M_100
+
X_111
(
dx
)
*
m_b
->
M_000
;
X_111
(
dx
)
*
m_b
->
M_000
;
#endif
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER > 3
#error "Missing implementation for order >3"
#endif
}
}
/**
/**
...
@@ -860,6 +880,9 @@ INLINE static void gravity_M2L(struct grav_tensor *l_b,
...
@@ -860,6 +880,9 @@ INLINE static void gravity_M2L(struct grav_tensor *l_b,
l_b
->
F_012
+=
m_a
->
M_000
*
D_012
(
dx
,
dy
,
dz
,
r_inv
);
l_b
->
F_012
+=
m_a
->
M_000
*
D_012
(
dx
,
dy
,
dz
,
r_inv
);
l_b
->
F_111
+=
m_a
->
M_000
*
D_111
(
dx
,
dy
,
dz
,
r_inv
);
l_b
->
F_111
+=
m_a
->
M_000
*
D_111
(
dx
,
dy
,
dz
,
r_inv
);
#endif
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER > 3
#error "Missing implementation for order >3"
#endif
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
l_b
->
mass_interacted
+=
m_a
->
M_000
;
l_b
->
mass_interacted
+=
m_a
->
M_000
;
...
@@ -983,6 +1006,9 @@ INLINE static void gravity_L2L(struct gravity_tensors *l_a,
...
@@ -983,6 +1006,9 @@ INLINE static void gravity_L2L(struct gravity_tensors *l_a,
la
->
F_012
+=
X_000
(
dx
)
*
lb
->
F_012
;
la
->
F_012
+=
X_000
(
dx
)
*
lb
->
F_012
;
la
->
F_111
+=
X_000
(
dx
)
*
lb
->
F_111
;
la
->
F_111
+=
X_000
(
dx
)
*
lb
->
F_111
;
#endif
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER > 3
#error "Missing implementation for order >3"
#endif
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
if
(
l_b
->
pot
.
mass_interacted
==
0
.
f
)
if
(
l_b
->
pot
.
mass_interacted
==
0
.
f
)
...
@@ -1040,6 +1066,10 @@ INLINE static void gravity_L2P(const struct gravity_tensors *l_b,
...
@@ -1040,6 +1066,10 @@ INLINE static void gravity_L2P(const struct gravity_tensors *l_b,
#endif
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER > 2
#if SELF_GRAVITY_MULTIPOLE_ORDER > 2
#endif
#endif
#if SELF_GRAVITY_MULTIPOLE_ORDER > 3
#error "Missing implementation for order >3"
#endif
}
}
#endif
/* SWIFT_MULTIPOLE_H */
#endif
/* SWIFT_MULTIPOLE_H */
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