Skip to content

Commit

Permalink
core: Remove unused globals and macros
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Feb 4, 2021
1 parent 7b5c1a0 commit a07a124
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/core/grid_based_algorithms/electrokinetics_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ extern bool ek_initialized;
void LBBoundaries::lb_init_boundaries();
#endif

#define PI_FLOAT 3.14159265358979323846f

EK_parameters ek_parameters = {
// agrid
-1.0,
Expand Down
5 changes: 0 additions & 5 deletions src/core/grid_based_algorithms/fd-electrostatics.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

#include <cufft.h>

#define PI_FLOAT 3.14159265358979323846f

class FdElectrostatics {
public:
struct InputParameters {
Expand Down Expand Up @@ -67,9 +65,6 @@ private:
bool initialized;
};

// extern __device__ __constant__ FdElectrostatics::Parameters
// fde_parameters_gpu;

__device__ cufftReal fde_getNode(int x, int y, int z);
__device__ cufftReal fde_getNode(int i);
__device__ void fde_setNode(int x, int y, int z, cufftReal value);
Expand Down
11 changes: 7 additions & 4 deletions src/core/grid_based_algorithms/fd-electrostatics_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

#include "cuda_utils.cuh"

#include <utils/constants.hpp>

#include <cuda.h>
#include <cufft.h>

Expand Down Expand Up @@ -149,14 +151,15 @@ __global__ void createGreensfcn() {
// setting 0th Fourier mode to 0 enforces charge neutrality
fde_parameters_gpu->greensfcn[index] = 0.0f;
} else {
constexpr cufftReal two_pi = 2.0f * Utils::pi<cufftReal>();
fde_parameters_gpu->greensfcn[index] =
-4.0f * PI_FLOAT * fde_parameters_gpu->prefactor *
-2.0f * two_pi * fde_parameters_gpu->prefactor *
fde_parameters_gpu->agrid * fde_parameters_gpu->agrid * 0.5f /
(cos(2.0f * PI_FLOAT * static_cast<cufftReal>(coord[0]) /
(cos(two_pi * static_cast<cufftReal>(coord[0]) /
static_cast<cufftReal>(fde_parameters_gpu->dim_x)) +
cos(2.0f * PI_FLOAT * static_cast<cufftReal>(coord[1]) /
cos(two_pi * static_cast<cufftReal>(coord[1]) /
static_cast<cufftReal>(fde_parameters_gpu->dim_y)) +
cos(2.0f * PI_FLOAT * static_cast<cufftReal>(coord[2]) /
cos(two_pi * static_cast<cufftReal>(coord[2]) /
static_cast<cufftReal>(fde_parameters_gpu->dim_z)) -
3.0f) /
static_cast<cufftReal>(fde_parameters_gpu->dim_x *
Expand Down

0 comments on commit a07a124

Please sign in to comment.