Skip to content

Commit

Permalink
Fix compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu committed Oct 28, 2024
1 parent f2a1c37 commit 29c4682
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
10 changes: 4 additions & 6 deletions src/nocmodl/noccout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,8 @@ void c_out() {
P(" }\n");
P("#if EXTRACELLULAR\n");
P(" if (auto* const _extnode = _nrn_mechanism_access_extnode(_nd); _extnode) {\n");
P(" int index = _nd->eqn_index_;\n");
P(" OcSparseMatrix& m = *_nt->_sp13mat;\n");
P(" *m.mep(index, index) += _g;\n");
P(" int ind = _nrn_mechanism_access_index(_nd);\n");
P(" *_nrn_mechanism_get_matrix_elem(_nt, ind, ind) += _g;\n");
P(" }\n");
P("#endif\n");
} else {
Expand Down Expand Up @@ -681,9 +680,8 @@ void c_out_vectorize() {
P(" }\n");
P("#if EXTRACELLULAR\n");
P(" if (auto* const _extnode = _nrn_mechanism_access_extnode(_nd); _extnode) {\n");
P(" int index = _nd->eqn_index_;\n");
P(" OcSparseMatrix& m = *_nt->_sp13mat;\n");
P(" *m.mep(index, index) += _g;\n");
P(" int ind = _nrn_mechanism_access_index(_nd);\n");
P(" *_nrn_mechanism_get_matrix_elem(_nt, ind, ind) += _g;\n");
P(" }\n");
P("#endif\n");
} else {
Expand Down
7 changes: 4 additions & 3 deletions src/nrnoc/extcelln.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "nrniv_mf.h"
#include "hocassrt.h"
#include "parse.hpp"
#include "ocmatrix.h"


extern int nrn_use_daspk_;
Expand Down Expand Up @@ -430,7 +431,7 @@ void nrn_setup_ext(NrnThread* _nt) {
OcSparseMatrix& m = *_nt->_sp13mat;
Node* nd = ndlist[i];
int index = nd->eqn_index_;
ExtNode* nde = nd->extnode;
Extnode* nde = nd->extnode;
double d = NODED(nd);
/* nde->_d only has -ELECTRODE_CURRENT contribution */
*m.mep(index, index) += NODED(nd);
Expand All @@ -448,7 +449,7 @@ void nrn_setup_ext(NrnThread* _nt) {
OcSparseMatrix& m = *_nt->_sp13mat;
Node* nd = ndlist[i];
int index = nd->eqn_index_;
ExtNode* nde = nd->extnode;
Extnode* nde = nd->extnode;
Node* pnd = _nt->_v_parent[nd->v_node_index];
if (pnd) {
/* series resistance and capacitance to ground */
Expand All @@ -464,7 +465,7 @@ void nrn_setup_ext(NrnThread* _nt) {
*m.mep(index - 1 + j, index + j) -= mfac;
*m.mep(index + j, index - 1 + j) -= mfac;
}
ExtNode* pnde = pnd->extnode;
Extnode* pnde = pnd->extnode;
/* axial connections */
if (pnde) { /* parent sec may not be extracellular */
OcSparseMatrix& m = *_nt->_sp13mat;
Expand Down
8 changes: 8 additions & 0 deletions src/nrnoc/membfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "multicore.h"
#include "section.h"
#include "ocmatrix.h"

#include <cassert>

Expand Down Expand Up @@ -49,6 +50,13 @@ double& _nrn_mechanism_access_rhs(Node* node) {
double& _nrn_mechanism_access_voltage(Node* node) {
return node->v();
}
int _nrn_mechanism_access_index(const Node* node) {
return node->eqn_index_;
}
double* _nrn_mechanism_get_matrix_elem(NrnThread* nt, int i, int j) {
OcSparseMatrix& m = *nt->_sp13mat;
return m.mep(i, j);
}
neuron::container::data_handle<double> _nrn_mechanism_get_area_handle(Node* node) {
if (node) {
return node->area_handle();
Expand Down
2 changes: 2 additions & 0 deletions src/nrnoc/membfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ namespace _get {
[[nodiscard]] double& _nrn_mechanism_access_param(Prop*, int field, int array_index = 0);
[[nodiscard]] double& _nrn_mechanism_access_rhs(Node*);
[[nodiscard]] double& _nrn_mechanism_access_voltage(Node*);
[[nodiscard]] int _nrn_mechanism_access_index(const Node*);
[[nodiscard]] double* _nrn_mechanism_get_matrix_elem(NrnThread* nt, int, int );
[[nodiscard]] neuron::container::data_handle<double> _nrn_mechanism_get_area_handle(Node*);
[[nodiscard]] Section* _nrn_mechanism_get_child(Section*);
[[nodiscard]] int _nrn_mechanism_get_nnode(Section*);
Expand Down
1 change: 1 addition & 0 deletions src/nrnoc/multicore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ the handling of v_structure_change as long as possible.
*/

#include "nmodlmutex.h"
#include "ocmatrix.h"

#include <cstdint>
#include <condition_variable>
Expand Down

0 comments on commit 29c4682

Please sign in to comment.