diff --git a/coreneuron/io/global_vars.cpp b/coreneuron/io/global_vars.cpp index f69f6256c..c9890cc4e 100644 --- a/coreneuron/io/global_vars.cpp +++ b/coreneuron/io/global_vars.cpp @@ -48,6 +48,7 @@ void set_globals(const char* path, bool cli_global_seed, int cli_global_seed_val (*n2v)["celsius"] = PSD(0, &celsius); (*n2v)["dt"] = PSD(0, &dt); (*n2v)["t"] = PSD(0, &t); + (*n2v)["PI"] = PSD(0, &pi); if (corenrn_embedded) { // CoreNEURON embedded, get info direct from NEURON diff --git a/coreneuron/io/lfp.hpp b/coreneuron/io/lfp.hpp index 8f99071b8..c34c5b788 100644 --- a/coreneuron/io/lfp.hpp +++ b/coreneuron/io/lfp.hpp @@ -6,8 +6,7 @@ #include #include -#include - +#include "coreneuron/nrnconf.h" #include "coreneuron/utils/nrn_assert.h" #include "coreneuron/mpi/nrnmpidec.h" @@ -156,7 +155,7 @@ struct LFPCalculator { if (seg_start.size() != radius.size()) { throw std::invalid_argument("Different number of segments and radii."); } - double f(1.0 / (extra_cellular_conductivity * 4.0 * boost::math::constants::pi())); + double f(1.0 / (extra_cellular_conductivity * 4.0 * pi)); m.resize(electrodes.size()); for (size_t k = 0; k < electrodes.size(); ++k) { diff --git a/coreneuron/mechanism/register_mech.cpp b/coreneuron/mechanism/register_mech.cpp index 05f8dbe20..3e5b452cc 100644 --- a/coreneuron/mechanism/register_mech.cpp +++ b/coreneuron/mechanism/register_mech.cpp @@ -19,10 +19,11 @@ namespace coreneuron { int secondorder = 0; -double t, dt, celsius; +double t, dt, celsius, pi; // declare copyin required for correct initialization #pragma acc declare copyin(secondorder) #pragma acc declare copyin(celsius) +#pragma acc declare copyin(pi) int rev_dt; using Pfrv = void (*)(); diff --git a/coreneuron/nrnconf.h b/coreneuron/nrnconf.h index b3fb173a3..064cc1547 100644 --- a/coreneuron/nrnconf.h +++ b/coreneuron/nrnconf.h @@ -32,6 +32,7 @@ using Symbol = char; #define VECTORIZE 1 extern double celsius; +extern double pi; extern double t, dt; extern int rev_dt; diff --git a/tests/unit/alignment/alignment.cpp b/tests/unit/alignment/alignment.cpp index 0bbf2ec09..4d5e0acea 100644 --- a/tests/unit/alignment/alignment.cpp +++ b/tests/unit/alignment/alignment.cpp @@ -14,7 +14,6 @@ #include #include -#include #include #include "coreneuron/utils/memory.h" diff --git a/tests/unit/lfp/lfp.cpp b/tests/unit/lfp/lfp.cpp index 7ed689efb..3d73479ff 100644 --- a/tests/unit/lfp/lfp.cpp +++ b/tests/unit/lfp/lfp.cpp @@ -4,11 +4,12 @@ #include #include -#include #include "coreneuron/io/lfp.hpp" #include "coreneuron/mpi/nrnmpi.h" +using namespace coreneuron; + template double integral(F f, double a, double b, int n) { double step = (b - a) / n; // width of each small rectangle @@ -28,7 +29,6 @@ std::array operator+(const std::array& x, const std::array } BOOST_AUTO_TEST_CASE(LFP_PointSource_LineSource) { - using namespace coreneuron; #if NRNMPI nrnmpi_init(nullptr, nullptr); #endif @@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE(LFP_PointSource_LineSource) { std::array segment_end = segment_start + std::array{0.0, 0.0, segment_length}; double floor{1.0e-6}; - double pi{3.141592653589}; + pi = 3.141592653589; std::array vals; double circling_radius{1.0e-6}; diff --git a/tests/unit/queueing/test_queueing.cpp b/tests/unit/queueing/test_queueing.cpp index 21ae3297f..830deebd0 100644 --- a/tests/unit/queueing/test_queueing.cpp +++ b/tests/unit/queueing/test_queueing.cpp @@ -10,7 +10,6 @@ #define TYPE T::cont #include -#include #include #include