1 #include <../../nrnconf.h> 57 #include <nrnmpiuse.h> 68 void (*nrnmpi_splitcell_compute_)();
95 double debugsolve(
void)
99 Section *
sec, *psec, *ch;
108 for (inode = sec->
nnode-1; inode >= 0; inode--) {
110 nd->savd =
NODED(nd);
132 if (inode < sec->
nnode-1) {
135 for (ch =
nd->child; ch; ch = ch->sibling){
137 pnd = psec->pnode[0];
161 ratio = ((double)inode+.5)/((double)sec->
nnode - 1.);
167 Section** prootsec,
Node** prootnode)
180 while (sec1 != sec2) {
200 if (node1 != node2) {
205 }
else if (node1 != node2) {
227 static Node* origin_node;
228 Node* my_origin_node;
229 Section* my_origin_sec;
242 my_origin_sec = (Section*)0;
244 (*nrnpy_o2loc2_p_)(
o, &my_origin_sec, &d_origin);
246 if (!my_origin_sec) {
247 hoc_execerror(
"Distance origin not valid.",
"If first argument is an Object, it needs to be a Python Segment object, a rxd.node object, or something with a segment property.");
249 my_origin_node =
node_exact(my_origin_sec, d_origin);
251 }
else if (
ifarg(1)) {
264 if (mode != 2 && (!origin_sec || !origin_sec->
prop)) {
265 hoc_execerror(
"Distance origin not valid.",
"Need to initialize origin with distance()");
269 my_origin_node = origin_node;
286 Section* sec = (Section*)
VOIDITM(q);
303 sprintf(direc,
"(%d-%d)", i, 1-i);
304 for (i=0; i<offset; i++)
Printf(
" ");
310 Printf(
"| %s%s with %g rall branches\n",
316 for (scnt=0, ch=sec->
child; ch; ++scnt, ch = ch->
sibling) {
323 dashes(ch, i+offset+1, 0140);
330 printf(
"\nnrn_solve enter %lx\n", (
long)_nt);
336 (*nrn_multisplit_solve_)();
347 Fprintf(stderr,
"solve error = %g\n", err);
365 spSolve(_nt->_sp13mat, _nt->_actual_rhs, _nt->_actual_rhs);
369 if (nrnmpi_splitcell_compute_) {
371 (*nrnmpi_splitcell_compute_)();
378 printf(
"\nnrn_solve leave %lx\n", (
long)_nt);
383 #if VECTORIZE && _CRAY 384 extern Node*** v_node_depth_lists;
385 extern Node*** v_parent_depth_lists;
386 extern int* v_node_depth_count;
387 extern int v_node_depth;
400 for (i = i3 - 1; i >= i2; --
i) {
408 for (i = i3 - 1; i >= i2; --
i) {
424 i2 = i1 + _nt->
ncell;
428 for (i = i1; i < i2; ++
i) {
431 for (i = i2; i < i3; ++
i) {
438 for (i = i1; i < i2; ++
i) {
441 for (i = i2; i < i3; ++
i) {
498 if (sec->
nnode == 0) {
520 if (ob && ob->
secelm_ == secitem) {
537 free((
char *)sec->
pt3d);
557 printf(
"section_unref: freed\n");
587 for (child = sec->
child; child; child = child->
sibling) {
599 for (i = n - 1; i >= 0; i--) {
614 nd->eqnblock = (Eqnblock *)0;
646 for (e = nd->eqnblock; e; e = e1) {
647 e1 = e->eqnblock_next;
666 for (i = n - 1; i >= 0; i--) {
688 for (p1 = nd1->
prop; p1; p1 = p1->
next) {
697 for (j=0; j < jmax; ++
j) {
702 for (i=0; i <
imax; ++
i) {
715 for (p1 = nd1->
prop; p1; p1 = p1->
next) {
741 int n1, n2, i1, i2,
i;
757 for (i1 = 0; i1 < n1; ++i1) {
758 x = (i1+.5)/(double)n1;
763 for (i2 = 0; i2 < n2; ++i2)
if (pn2[i2] ==
NULL) {
764 x = (i2 + 0.5)/(double)n2;
768 for (i1 = 0; i1 < n1; ++i1) {
772 for (i2 = 0; i2 < n2; ++i2) {
773 x = (i2+.5)/(double)n2;
780 for (i2=0; i2 < n2; ++i2) {
782 x2 = (i2+1.)/(double)n2;
783 for (; i1 < n1; ++i1) {
784 x1 = (i1+.5)/(double)n1;
788 if (pn1[i1] == (
Node*)0) {
792 printf(
"moving point processes from pn1[%d] to pn2[%d]\n", i1, i2);
793 printf(
"i.e. x1=%g in the range %g to %g\n", x1, x2-1./n2, x2);
801 for (i2=0; i2 < nseg; ++i2) {
830 for (i=0; i < nseg; ++
i) {
852 free((
char *)secorder);
853 secorder = (Section**)0;
870 Section* psec, *
s =
sec;
872 if (!psec || s->
order >= 0) {
874 }
else if (psec == sec) {
875 fprintf(stderr,
"A loop exists consisting of:\n %s",
secname(sec));
879 fprintf(stderr,
" %s\nUse <section> disconnect() to break the loop\n ",
secname(sec));
885 sec = secorder[isec];
887 secorder[
order] = ch;
static Node * node_interp(Node *nd1, Node *nd2, double frac)
assert(order==section_count)
size_t hoc_total_array_data(Symbol *s, Objectdata *obd)
void * ecalloc(size_t n, size_t size)
void nrn_solve(NrnThread *_nt)
void extcell_2d_alloc(Section *sec)
void node_alloc(Section *sec, short nseg)
void hoc_pushobj(Object **d)
static void bksub(NrnThread *)
int node_index_exact(Section *sec, double x)
double topol_distance(Section *sec1, Node *node1, Section *sec2, Node *node2, Section **prootsec, Node **prootnode)
struct Section * parentsec
void nrn_section_free(Section *s)
static void pnode(Prop *)
void hoc_l_delete(hoc_Item *)
#define ITERATE(itm, lst)
int hoc_is_double_arg(int narg)
void nrn_clear_mark(void)
Represent main neuron object computed by single thread.
Node * nrn_node_construct1(void)
void notify_freed_val_array(double *p, size_t size)
void nrn_node_destruct1(Node *nd)
Node ** node_construct(int n)
void sec_free(hoc_Item *secitem)
void(* nrn_multisplit_solve_)()
void nrn_thread_error(const char *)
void nrn_print_matrix(NrnThread *_nt)
static void dashes(Section *sec, int offset, int first)
static void triang(NrnThread *)
sprintf(buf," if (secondorder) {\ " int _i;\" " for(_i=0;_i< %d;++_i) {\" " _p[_slist%d[_i]]+=dt *_p[_dlist%d[_i]];\" " }}\", numeqn, listnum, listnum)
short nrn_increment_mark(Section *sec)
static void section_unlink(Section *sec)
struct Pt3d * logical_connection
short nrn_value_mark(Section *sec)
void extnode_free_elements(Extnode *nde)
void section_unref(Section *sec)
ForAllSections(sec) if(!sec -> parentsec)
int const size_t const size_t n
HocStruct Symbol ** ppsym
double nrn_connection_position(Section *sec)
const char * secname(Section *sec)
Prop * prop_alloc(Prop **, int, Node *)
void hoc_execerror(const char *, const char *)
HocStruct hoc_Item * secelm_
void nrn_seg_or_x_arg2(int iarg, Section **psec, double *px)
fprintf(stderr, "Don't know the location of params at %p\, pp)
double nrn_section_orientation(Section *sec)
void node_destruct(Node **pnode, int n)
void nrnhoc_topology(void)
char * emalloc(unsigned n)
void(* nrnpy_o2loc2_p_)(Object *, Section **, double *)
double section_length(Section *sec)
void section_ref(Section *sec)
void(* nrnpy_o2loc_p_)(Object *, Section **, double *)
void nrn_relocate_old_points(Section *oldsec, Node *oldnode, Section *sec, Node *node)
struct Symbol::@52::@53 rng
double node_dist(Section *sec, Node *node)
static Section * origin_sec
Section * nrn_section_alloc()
void nrn_disconnect(Section *sec)
static Node * node_clone(Node *nd1)
static Node * node(Object *)
Object ** hoc_objgetarg(int)
Section * chk_access(void)
void nrn_sec_ref(Section **psec, Section *sec)
Node * node_exact(Section *sec, double x)
double chkarg(int, double low, double high)
Section * sec_alloc(void)
static void node_realloc(Section *sec, short nseg)