Skip to content

Commit

Permalink
Stop pre-allocating _sp13mat
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu committed Oct 28, 2024
1 parent 29c4682 commit a9fde15
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/nrnoc/treeset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1912,40 +1912,9 @@ static void nrn_matrix_node_alloc(void) {
i += nlayer;
}
}
// Creating
for (int in = 0; in < nt->end; ++in) {
Node *nd = nt->_v_node[in];
Extnode* nde = nd->extnode;
Node *pnd = nt->_v_parent[in];
int i = nd->eqn_index_;
nt->_sp13mat->mep(i - 1, i - 1);
if (nde) {
for (int ie = 0; ie < nlayer; ++ie) {
int k = i + ie;
nt->_sp13mat->mep(k, k);
nt->_sp13mat->mep(k, k - 1);
nt->_sp13mat->mep(k - 1, k);
}
}
if (pnd) {
int j = pnd->eqn_index_;
nt->_sp13mat->mep(j - 1, i - 1);
nt->_sp13mat->mep(i - 1, j - 1);
if (nde && pnd->extnode)
for (int ie = 0; ie < nlayer; ++ie) {
int kp = j + ie;
int k = i + ie;
nt->_sp13mat->mep(kp, k);
nt->_sp13mat->mep(k, kp);
}
}
}
nt->_sp13mat->compress();
// Collecting
for (int in = 0; in < nt->end; ++in) {
Node *nd = nt->_v_node[in];
Extnode* nde = nd->extnode;
Node *pnd = nt->_v_parent[in];
int i = nd->eqn_index_;
nt->_sp13_rhs[i] = nt->actual_rhs(in);
if (nde) {
Expand Down

0 comments on commit a9fde15

Please sign in to comment.