54 #include <../../nmodlconf.h>
92 printf(
"NET_RECEIVE discontinuity for %s\n", sym->
name);
105 if (
strstr(cnexp,
" _l")) {
114 printf(
"cnexp is |%s|\n", cnexp ? cnexp :
"NULL");
115 if (cnexp && !case_cnexp) {
116 printf(
"because of local variable, use the general case\n");
118 printf(
"because not cnexp, use the general case\n");
129 " if (nrn_netrec_state_adjust && !cvode_active_){\n"
130 " /* discon state adjustment for cnexp case (rate uses no local variable) */\n"
131 " double __state = %s;\n"
132 " double __primary = (%s) - __state;\n"
134 " %s += __primary;\n"
172 fprintf(stderr,
"Notice: %s discontinuity adjustment not available.\n", sym->
name);
178 printf(
"general_discon_adjust listnum=%d sindex=%d neq=%d\n", listnum, sindex, neq);
186 needv = strdup(
" v = NODEV(_pnt->node);\n");
192 "#if NRN_VECTORIZED\n _thread = _nt->_ml_list[_mechtype]->_thread;\n#endif\n");
194 needthread = strdup(
"");
197 " if (nrn_netrec_state_adjust && !cvode_active_){\n"
198 " /* discon state adjustment for general derivimplicit and KINETIC case */\n"
199 " int __i, __neq = %d;\n"
200 " double __state = %s;\n"
201 " double __primary_delta = (%s) - __state;\n"
202 " double __dtsav = dt;\n"
203 " for (__i = 0; __i < __neq; ++__i) {\n"
204 " _p[_dlist%d[__i]] = 0.0;\n"
206 " _p[_dlist%d[%d]] = __primary_delta;\n"
209 " _ode_matsol_instance%d(_threadargs_);\n"
211 " for (__i = 0; __i < __neq; ++__i) {\n"
212 " _p[_slist%d[__i]] += _p[_dlist%d[__i]];\n"
sprintf(buf, " if (secondorder) {\n" " int _i;\n" " for (_i = 0; _i < %d; ++_i) {\n" " _p[_slist%d[_i]] += dt*_p[_dlist%d[_i]];\n" " }}\n", numeqn, listnum, listnum)
#define ITERATE(itm, lst)
NMODL parser global flags / functions.
Item * insertstr(Item *item, char *str)
Item * lappenditem(List *list, Item *item)
static int equal(char *s1, char *s2)
static void general_discon_adjust(Item *varname, Item *equal, Item *expr, Item *lastok)
static void netrec_discon1(Item *varname, Item *equal, Item *expr, Item *lastok)
void netrec_asgn(Item *varname, Item *equal, Item *expr, Item *lastok)
int slist_search(int listnum, Symbol *s)
char * items_as_string(Item *begin, Item *last)
void debugprintitem(Item *)
char * strstr(char *cs, char *ct)