1 #include <../../nrnconf.h>
29 neqn += item->extra_eqn_count();
50 item->alloc(
neqn + 1);
51 neqn += item->extra_eqn_count();
64 hoc_execerror(
"NrnDAEs only work with secondorder==0 or daspk", 0);
92 void nrndae_dkmap(std::vector<double*>& pv, std::vector<double*>& pvdot) {
94 item->dkmap(pv, pvdot);
102 item->dkres(y, yprime, delta);
147 void (*f_init)(
void*
data),
158 const int size =
y_.
size();
161 for (
int i = 0;
i < size;
i++)
166 Vect& elay = *elayer;
300 delta[
bmap_[
i] - 1] -= (*cyp)[
i];
double const * data() const
void alloc(int, int, Node **, int *)
void mulv(Vect &in, Vect &out)
NEURON Differential Algebraic Equations.
int size_
total number of states declared or modified in this object
void v2y()
Transfer any voltage states to y_.
void rhs()
Compute the right side portion of.
int start_
the position of the first added equation (if any) in the global system
virtual ~NrnDAE()
Destructor.
int nnode_
Number of voltage nodes used by the dynamics.
virtual double jacobian_multiplier_()
Vect cyp_
temporary vector used for residual calculation.
virtual void f_(Vect &y, Vect &yprime, int size)=0
The right-hand-side function.
void alloc(int start_index)
Allocate space for these dynamics in the overall system.
void lhs()
Compute the left side portion of.
Vect yptmp_
temporary vector used for residual calculation.
virtual void alloc_(int size, int start, int nnode, Node **nodes, int *elayer)
Additional allocation for subclasses.
void update()
Update states to reflect the changes over a time-step.
void * data_
Data to pass to f_init_.
NrnDAE(Matrix *cmat, Vect *const yvec, Vect *const y0, int nnode, Node **const nodes, Vect *const elayer, void(*f_init)(void *data)=NULL, void *const data=NULL)
Constructor.
void dkres(double *y, double *yprime, double *delta)
Compute the residual:
int * bmap_
mapping between the states in y and the states in the whole system
void dkmap(std::vector< double * > &pv, std::vector< double * > &pvdot)
Setup the map between voltages and states in y_.
Matrix * assumed_identity_
identity matrix if constructed with
Vect * y0_
vector of initial conditions
Node ** nodes_
Pointers to voltage nodes used by the dynamics.
void init()
Initialize the dynamics.
virtual MatrixMap * jacobian_(Vect &y)=0
Compute the Jacobian.
Vect & y_
vector to store the state variables in
int * elayer_
Which voltage layers to read from.
void(* f_init_)(void *data)
Function used for initializing the state variables.
int extra_eqn_count()
Find the number of state variables introduced by this object.
#define y_(arg)
Crout matrix decomposition : Forward/Backward substitution.
void hoc_execerror(const char *s1, const char *s2)
void nrndae_dkres(double *y, double *yprime, double *delta)
int nrndae_extra_eqn_count()
void nrndae_rhs(NrnThread *_nt)
static NrnDAEPtrList nrndae_list
int nrndae_list_is_empty()
void nrndae_dkmap(std::vector< double * > &pv, std::vector< double * > &pvdot)
void nrndae_update(NrnThread *_nt)
void nrndae_register(NrnDAE *n)
Add a NrnDAE object to the system.
void nrndae_deregister(NrnDAE *n)
Remove a NrnDAE object from the system.
Supports modifying voltage equations and adding new equations.
std::list< NrnDAE * > NrnDAEPtrList
void nrn_matrix_node_free()
int const size_t const size_t n
void nrn_thread_error(const char *s)
Represent main neuron object computed by single thread.
Memb_list * _ecell_memb_list
void update_actual_d_based_on_sp13_mat(NrnThread *nt)
void update_actual_rhs_based_on_sp13_rhs(NrnThread *nt)
void update_sp13_rhs_based_on_actual_rhs(NrnThread *nt)
void update_sp13_mat_based_on_actual_d(NrnThread *nt)