Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
0c59431e
Commit
0c59431e
authored
May 13, 2018
by
Matthieu Schaller
Browse files
Add the function to interpolate a m-pole from/to the mesh to the public interface.
parent
78e78397
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/runner_doiact_fft.c
View file @
0c59431e
...
...
@@ -95,9 +95,8 @@ __attribute__((always_inline)) INLINE static double CIC_get(
* @param fac The width of a mesh cell.
* @param dim The dimensions of the simulation box.
*/
__attribute__
((
always_inline
))
INLINE
static
void
multipole_to_mesh_CIC
(
const
struct
gravity_tensors
*
m
,
double
*
rho
,
int
N
,
double
fac
,
const
double
dim
[
3
])
{
void
multipole_to_mesh_CIC
(
const
struct
gravity_tensors
*
m
,
double
*
rho
,
int
N
,
double
fac
,
const
double
dim
[
3
])
{
/* Box wrap the multipole's position */
const
double
CoM_x
=
box_wrap
(
m
->
CoM
[
0
],
0
.,
dim
[
0
]);
...
...
@@ -137,6 +136,7 @@ __attribute__((always_inline)) INLINE static void multipole_to_mesh_CIC(
rho
[
row_major_id
(
i
+
1
,
j
+
1
,
k
+
0
,
N
)]
+=
mass
*
dx
*
dy
*
tz
;
rho
[
row_major_id
(
i
+
1
,
j
+
1
,
k
+
1
,
N
)]
+=
mass
*
dx
*
dy
*
dz
;
}
/**
* @brief Computes the potential on a multipole from a given mesh using the CIC
* method.
...
...
@@ -147,9 +147,8 @@ __attribute__((always_inline)) INLINE static void multipole_to_mesh_CIC(
* @param fac width of a mesh cell.
* @param dim The dimensions of the simulation box.
*/
__attribute__
((
always_inline
))
INLINE
static
void
mesh_to_multipole_CIC
(
struct
gravity_tensors
*
m
,
const
double
*
pot
,
int
N
,
double
fac
,
const
double
dim
[
3
])
{
void
mesh_to_multipole_CIC
(
struct
gravity_tensors
*
m
,
const
double
*
pot
,
int
N
,
double
fac
,
const
double
dim
[
3
])
{
/* Box wrap the multipole's position */
const
double
CoM_x
=
box_wrap
(
m
->
CoM
[
0
],
0
.,
dim
[
0
]);
...
...
src/runner_doiact_fft.h
View file @
0c59431e
...
...
@@ -20,7 +20,14 @@
#define SWIFT_RUNNER_DOIACT_FFT_H
struct
runner
;
struct
gravity_tensors
;
void
runner_do_grav_fft
(
struct
runner
*
r
,
int
timer
);
void
runner_do_grav_fft
(
struct
runner
*
r
,
int
timer
);
void
multipole_to_mesh_CIC
(
const
struct
gravity_tensors
*
m
,
double
*
rho
,
int
N
,
double
fac
,
const
double
dim
[
3
]);
void
mesh_to_multipole_CIC
(
struct
gravity_tensors
*
m
,
const
double
*
pot
,
int
N
,
double
fac
,
const
double
dim
[
3
]);
#endif
/* SWIFT_RUNNER_DOIACT_FFT_H */
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment