Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for new data structures #2

Merged
merged 1 commit into from
Apr 30, 2023
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
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ Edits:
20220519 - zipped Iintra.dat to allow storing on GitHub
20220523 - updated MOD files to contain valid C++ and be compatible
with the upcoming versions 8.2 and 9.0 of NEURON.
20230420 - updated MOD files for compatibility with the new data
structures in the upcoming version 9.0 of NEURON.
15 changes: 12 additions & 3 deletions ri.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ NEURON { SUFFIX nothing }

VERBATIM
const char* secname();
#ifdef NRN_MECHANISM_DATA_IS_SOA
#define get_nnode(sec) _nrn_mechanism_get_nnode(sec)
#define get_node(sec, node_index) _nrn_mechanism_get_node(sec, node_index)
#define get_thread(node) _nrn_mechanism_get_thread(node)
#else
#define get_nnode(sec) sec->nnode
#define get_node(sec, node_index) sec->pnode[node_index]
#define get_thread(node) node->_nt
#endif
ENDVERBATIM

PROCEDURE scale_connection_coef(x, factor) {
Expand All @@ -40,13 +49,13 @@ VERBATIM {
/*printf("scale_connection_coefs %s(%g) %d\n", secname(sec), _lx, sec->nnode);*/
/* assumes 0 end of child connected to parent */
if (_lx == 1.) {
nd = sec->pnode[sec->nnode-1];
nd = get_node(sec, get_nnode(sec) - 1);
}else{
nd = sec->pnode[(int) (_lx*(double)(sec->nnode-1))];
nd = get_node(sec, (int) (_lx*(double)(get_nnode(sec) - 1)));
}
/*printf("%g %g\n", NODEA(nd), NODEB(nd));*/
#if defined(t)
_nt = nd->_nt;
_nt = get_thread(nd);
#endif
NODEA(nd) *= _lfactor;
NODEB(nd) *= _lfactor;
Expand Down