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
0c59431e
Commit
0c59431e
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Add the function to interpolate a m-pole from/to the mesh to the public interface.
parent
78e78397
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/runner_doiact_fft.c
+5
-6
5 additions, 6 deletions
src/runner_doiact_fft.c
src/runner_doiact_fft.h
+8
-1
8 additions, 1 deletion
src/runner_doiact_fft.h
with
13 additions
and
7 deletions
src/runner_doiact_fft.c
+
5
−
6
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
]);
...
...
This diff is collapsed.
Click to expand it.
src/runner_doiact_fft.h
+
8
−
1
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 */
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