54 #include <../../nmodlconf.h> 76 if (!info) { info =
newlist(); }
90 printf(
"NET_RECEIVE discontinuity for %s\n", sym->
name);
92 if (netrec_cnexp)
ITERATE(q, netrec_cnexp) {
102 if (
strstr(cnexp,
" _l")) {
111 printf(
"cnexp is |%s|\n", cnexp ? cnexp :
"NULL");
112 if (cnexp && !case_cnexp) {
113 printf(
"because of local variable, use the general case\n");
115 printf(
"because not cnexp, use the general case\n");
126 " if (nrn_netrec_state_adjust && !cvode_active_){\n" 127 " /* discon state adjustment for cnexp case (rate uses no local variable) */\n" 128 " double __state = %s;\n" 129 " double __primary = (%s) - __state;\n" 131 " %s += __primary;\n" 132 " } else {\n", state, e, cnexp, state);
162 fprintf(stderr,
"Notice: %s discontinuity adjustment not available.\n", sym->
name);
168 printf(
"general_discon_adjust listnum=%d sindex=%d neq=%d\n", listnum, sindex, neq);
176 needv = strdup(
" v = NODEV(_pnt->node);\n");
181 needthread = strdup(
"#if NRN_VECTORIZED\n _thread = _nt->_ml_list[_mechtype]->_thread;\n#endif\n");
183 needthread = strdup(
"");
186 " if (nrn_netrec_state_adjust && !cvode_active_){\n" 187 " /* discon state adjustment for general derivimplicit and KINETIC case */\n" 188 " int __i, __neq = %d;\n" 189 " double __state = %s;\n" 190 " double __primary_delta = (%s) - __state;\n" 191 " double __dtsav = dt;\n" 192 " for (__i = 0; __i < __neq; ++__i) {\n" 193 " _p[_dlist%d[__i]] = 0.0;\n" 195 " _p[_dlist%d[%d]] = __primary_delta;\n" 198 " _ode_matsol_instance%d(_threadargs_);\n" 200 " for (__i = 0; __i < __neq; ++__i) {\n" 201 " _p[_slist%d[__i]] += _p[_dlist%d[__i]];\n" 203 " } else {\n", neq, state, e, listnum, listnum, sindex, needv, needthread, listnum, listnum, listnum);
char * strstr(cs, ct) char *cs
void debugprintitem(Item *)
#define ITERATE(itm, lst)
void netrec_asgn(Item *varname, Item *equal, Item *expr, Item *lastok)
sprintf(buf," if (secondorder) {\ " int _i;\" " for(_i=0;_i< %d;++_i) {\" " _p[_slist%d[_i]]+=dt *_p[_dlist%d[_i]];\" " }}\", numeqn, listnum, listnum)
char * items_as_string(Item *begin, Item *last)
static void netrec_discon1(Item *varname, Item *equal, Item *expr, Item *lastok)
int slist_search(int listnum, Symbol *s)
static void general_discon_adjust(Item *varname, Item *equal, Item *expr, Item *lastok)
fprintf(stderr, "Don't know the location of params at %p\, pp)
NMODL parser global flags / functions.
Item * lappenditem(List *list, Item *item)
static int equal(char *s1, char *s2)
Item * insertstr(Item *item, char *str)