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
5a59eca3
Commit
5a59eca3
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
When replicating the particles peridoically, propagate the correct mesh size to the PM calculation.
parent
dfed1bca
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
examples/main.c
+13
-13
13 additions, 13 deletions
examples/main.c
src/mesh_gravity.c
+2
-0
2 additions, 0 deletions
src/mesh_gravity.c
with
15 additions
and
13 deletions
examples/main.c
+
13
−
13
View file @
5a59eca3
...
...
@@ -777,19 +777,6 @@ int main(int argc, char *argv[]) {
/* Verify that the fields to dump actually exist */
if
(
myrank
==
0
)
io_check_output_fields
(
params
,
N_total
);
/* Initialise the long-range gravity mesh */
if
(
with_self_gravity
&&
periodic
)
{
#ifdef HAVE_FFTW
pm_mesh_init
(
&
mesh
,
&
gravity_properties
,
dim
);
#else
/* Need the FFTW library if periodic and self gravity. */
error
(
"No FFTW library found. Cannot compute periodic long-range forces."
);
#endif
}
else
{
pm_mesh_init_no_mesh
(
&
mesh
,
dim
);
}
/* Initialize the space with these data. */
if
(
myrank
==
0
)
clocks_gettime
(
&
tic
);
space_init
(
&
s
,
params
,
&
cosmo
,
dim
,
parts
,
gparts
,
sparts
,
Ngas
,
Ngpart
,
...
...
@@ -803,6 +790,19 @@ int main(int argc, char *argv[]) {
fflush
(
stdout
);
}
/* Initialise the long-range gravity mesh */
if
(
with_self_gravity
&&
periodic
)
{
#ifdef HAVE_FFTW
pm_mesh_init
(
&
mesh
,
&
gravity_properties
,
s
.
dim
);
#else
/* Need the FFTW library if periodic and self gravity. */
error
(
"No FFTW library found. Cannot compute periodic long-range forces."
);
#endif
}
else
{
pm_mesh_init_no_mesh
(
&
mesh
,
s
.
dim
);
}
/* Check that the matter content matches the cosmology given in the
* parameter file. */
if
(
with_cosmology
&&
with_self_gravity
&&
!
dry_run
)
...
...
This diff is collapsed.
Click to expand it.
src/mesh_gravity.c
+
2
−
0
View file @
5a59eca3
...
...
@@ -291,6 +291,8 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct space* s,
const
double
dim
[
3
]
=
{
s
->
dim
[
0
],
s
->
dim
[
1
],
s
->
dim
[
2
]};
if
(
r_s
<=
0
.)
error
(
"Invalid value of a_smooth"
);
if
(
mesh
->
dim
[
0
]
!=
dim
[
0
]
||
mesh
->
dim
[
1
]
!=
dim
[
1
]
||
mesh
->
dim
[
2
]
!=
dim
[
2
])
error
(
"Domain size does not match the value stored in the space."
);
/* Some useful constants */
const
int
N
=
mesh
->
N
;
...
...
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