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
8ba12d1f
Commit
8ba12d1f
authored
Jul 06, 2018
by
Matthieu Schaller
Browse files
Properly protect the periodic gravity code against the absence of the FFTW library.
parent
e95331dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
doc/Doxyfile.in
View file @
8ba12d1f
...
...
@@ -1991,6 +1991,7 @@ INCLUDE_FILE_PATTERNS =
PREDEFINED = "__attribute__(x)= "
PREDEFINED += HAVE_HDF5
PREDEFINED += HAVE_FFTW
PREDEFINED += WITH_MPI
PREDEFINED += WITH_VECTORIZATION
PREDEFINED += __GNUC__
...
...
src/mesh_gravity.c
View file @
8ba12d1f
...
...
@@ -38,6 +38,8 @@
#include
"runner.h"
#include
"space.h"
#ifdef HAVE_FFTW
/**
* @brief Returns 1D index of a 3D NxNxN array using row-major style.
*
...
...
@@ -264,6 +266,8 @@ void mesh_to_gparts_CIC(struct gpart* gp, const double* pot, int N, double fac,
#endif
}
#endif
/**
* @brief Compute the potential, including periodic correction on the mesh.
*
...
...
@@ -532,7 +536,7 @@ void pm_mesh_struct_restore(struct pm_mesh* mesh, FILE* stream) {
restart_read_blocks
((
void
*
)
mesh
,
sizeof
(
struct
pm_mesh
),
1
,
stream
,
NULL
,
"gravity props"
);
#ifdef HAVE_FFTW
const
int
N
=
mesh
->
N
;
/* Allocate the memory for the combined density and potential array */
...
...
@@ -540,7 +544,6 @@ void pm_mesh_struct_restore(struct pm_mesh* mesh, FILE* stream) {
if
(
mesh
->
potential
==
NULL
)
error
(
"Error allocating memory for the long-range gravity mesh."
);
#ifdef HAVE_FFTW
#else
error
(
"No FFTW library found. Cannot compute periodic long-range forces."
);
#endif
...
...
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