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
78b40cc6
Commit
78b40cc6
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Clearer description of the mesh inteprolation in terms of the absence of constant terms.
parent
307f45a8
No related branches found
No related tags found
2 merge requests
!566
Periodic gravity calculation
,
!565
Mesh force task
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mesh_gravity.c
+14
-8
14 additions, 8 deletions
src/mesh_gravity.c
with
14 additions
and
8 deletions
src/mesh_gravity.c
+
14
−
8
View file @
78b40cc6
...
@@ -315,7 +315,9 @@ void mesh_to_gparts_CIC(struct gpart* gp, const double* pot, int N, double fac,
...
@@ -315,7 +315,9 @@ void mesh_to_gparts_CIC(struct gpart* gp, const double* pot, int N, double fac,
*
*
* Interpolates the top-level multipoles on-to a mesh, move to Fourier space,
* Interpolates the top-level multipoles on-to a mesh, move to Fourier space,
* compute the potential including short-range correction and move back
* compute the potential including short-range correction and move back
* to real space.
* to real space. We use CIC for the interpolation.
*
* Note that there is no multiplication by G_newton at this stage.
*
*
* @param mesh The #pm_mesh used to store the potential.
* @param mesh The #pm_mesh used to store the potential.
* @param e The #engine from which to compute the forces.
* @param e The #engine from which to compute the forces.
...
@@ -458,13 +460,6 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct engine* e) {
...
@@ -458,13 +460,6 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct engine* e) {
/* message("\n\n\n POTENTIAL"); */
/* message("\n\n\n POTENTIAL"); */
/* print_array(potential, N); */
/* print_array(potential, N); */
/* #ifdef SWIFT_GRAVITY_FORCE_CHECKS */
/* /\* Get the potential from the mesh to the gparts using CIC *\/ */
/* for (size_t i = 0; i < s->nr_gparts; ++i) */
/* mesh_to_gparts_CIC(&s->gparts[i], mesh->potential, N, cell_fac, dim);
*/
/* #endif */
/* Clean-up the mess */
/* Clean-up the mess */
fftw_destroy_plan
(
forward_plan
);
fftw_destroy_plan
(
forward_plan
);
fftw_destroy_plan
(
inverse_plan
);
fftw_destroy_plan
(
inverse_plan
);
...
@@ -475,6 +470,17 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct engine* e) {
...
@@ -475,6 +470,17 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct engine* e) {
#endif
#endif
}
}
/**
* @brief Interpolate the forces and potential from the mesh to the #gpart.
*
* We use CIC interpolation. The resulting accelerations and potential must
* be multiplied by G_newton.
*
* @param mesh The #pm_mesh (containing the potential) to interpolate from.
* @param e The #engine (to check active status).
* @param gparts The #gpart to interpolate to.
* @param gcount The number of #gparts.
*/
void
pm_mesh_interpolate_forces
(
const
struct
pm_mesh
*
mesh
,
void
pm_mesh_interpolate_forces
(
const
struct
pm_mesh
*
mesh
,
const
struct
engine
*
e
,
struct
gpart
*
gparts
,
const
struct
engine
*
e
,
struct
gpart
*
gparts
,
int
gcount
)
{
int
gcount
)
{
...
...
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