{# This template generates the solver event portion of the update loop. Template variables are: - modelName: the name of the current system - synapticEventDefs - a list of synaptic event objects that have the following fields: - pscName - descriptive name (label) of the post-synaptic conductance component - pscId - unique identifier of the post-synaptic conductance component #} int events = 0; {% for synapticEvent in synapticEventDefs %} events = events + {{synapticEvent.pscName}}_transients (lag); {% endfor %} {% if (ODEmethod == "cvode") %} /* Reinitializes CVode state if any synaptic events have occurred */ if (events > 0) { int status = CVodeReInit (B_.sys_, tt, B_.y); if (check_flag(&status, "CVodeReInit", 1)) throw CVodeSolverFailure (get_name(), status); } {% elif (ODEmethod == "ida") %} /* Reinitializes IDA state if any synaptic events have occurred */ if (events > 0) { int status = IDAReInit (B_.sys_, tt, B_.y, B_.yp); if (check_flag(&status, "IDAReInit", 1)) throw IDASolverFailure (get_name(), status); } {% elif (ODEmethod == "gsl") %} /* Resets the GSL stepping function if any synaptic events have occurred */ if (events > 0) { gsl_odeiv2_step_reset (B_.s_); } {% endif %}