54 #include <../../nrnconf.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"
171 fprintf(stderr,
"Notice: %s discontinuity adjustment not available.\n", sym->
name);
177 printf(
"general_discon_adjust listnum=%d sindex=%d neq=%d\n", listnum, sindex, neq);
185 needv = strdup(
" v = NODEV(_pnt->node);\n");
191 "#if NRN_VECTORIZED\n _thread = _nt->_ml_list[_mechtype]->_thread;\n#endif\n");
193 needthread = strdup(
"");
196 " if (nrn_netrec_state_adjust && !cvode_active_){\n"
197 " /* discon state adjustment for general derivimplicit and KINETIC case */\n"
198 " int __i, __neq = %d;\n"
199 " double __state = %s;\n"
200 " double __primary_delta = (%s) - __state;\n"
201 " double __dtsav = dt;\n"
202 " for (__i = 0; __i < __neq; ++__i) {\n"
203 " _ml->data(_iml, _dlist%d[__i]) = 0.0;\n"
205 " _ml->data(_iml, _dlist%d[%d]) = __primary_delta;\n"
208 " _ode_matsol_instance%d(_threadargs_);\n"
210 " for (__i = 0; __i < __neq; ++__i) {\n"
211 " _ml->data(_iml, _slist%d[__i]) += _ml->data(_iml, _dlist%d[__i]);\n"
#define ITERATE(itm, lst)
Item * lappenditem(List *list, Item *item)
Item * insertstr(Item *item, const char *str)
List * newlist()
The following routines support the concept of a list.
int Sprintf(char(&buf)[N], const char *fmt, Args &&... args)
Redirect sprintf to snprintf if the buffer size can be deduced.
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 *)
NMODL parser global flags / functions.
static int equal(const char *c1, const char *c2)