Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions coreneuron/io/global_vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Comment thread
pramodk marked this conversation as resolved.

if (corenrn_embedded) { // CoreNEURON embedded, get info direct from NEURON

Expand Down
5 changes: 2 additions & 3 deletions coreneuron/io/lfp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#include <iostream>
#include <vector>

#include <boost/math/constants/constants.hpp>

#include "coreneuron/nrnconf.h"
#include "coreneuron/utils/nrn_assert.h"
#include "coreneuron/mpi/nrnmpidec.h"

Expand Down Expand Up @@ -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>()));
double f(1.0 / (extra_cellular_conductivity * 4.0 * pi));

m.resize(electrodes.size());
for (size_t k = 0; k < electrodes.size(); ++k) {
Expand Down
3 changes: 2 additions & 1 deletion coreneuron/mechanism/register_mech.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 (*)();
Expand Down
1 change: 1 addition & 0 deletions coreneuron/nrnconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ using Symbol = char;
#define VECTORIZE 1

extern double celsius;
extern double pi;

extern double t, dt;
extern int rev_dt;
Expand Down
1 change: 0 additions & 1 deletion tests/unit/alignment/alignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <stdint.h>

#include <boost/test/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
#include <boost/mpl/list.hpp>

#include "coreneuron/utils/memory.h"
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/lfp/lfp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
#include <iostream>

#include <boost/test/unit_test.hpp>
#include <boost/test/test_case_template.hpp>

#include "coreneuron/io/lfp.hpp"
#include "coreneuron/mpi/nrnmpi.h"

using namespace coreneuron;

template <typename F>
double integral(F f, double a, double b, int n) {
double step = (b - a) / n; // width of each small rectangle
Expand All @@ -28,7 +29,6 @@ std::array<double, 3> operator+(const std::array<double, 3>& x, const std::array
}

BOOST_AUTO_TEST_CASE(LFP_PointSource_LineSource) {
using namespace coreneuron;
#if NRNMPI
nrnmpi_init(nullptr, nullptr);
#endif
Expand All @@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE(LFP_PointSource_LineSource) {
std::array<double, 3> segment_end = segment_start +
std::array<double, 3>{0.0, 0.0, segment_length};
double floor{1.0e-6};
double pi{3.141592653589};
pi = 3.141592653589;
Comment thread
pramodk marked this conversation as resolved.

std::array<double, 10> vals;
double circling_radius{1.0e-6};
Expand Down
1 change: 0 additions & 1 deletion tests/unit/queueing/test_queueing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define TYPE T::cont

#include <boost/test/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
#include <boost/filesystem.hpp>

#include <cstdlib>
Expand Down