NEURON
section_fwd.hpp
Go to the documentation of this file.
1 #pragma once
2 #include "multicore.h"
4 #include "nrnredef.h"
5 /**
6  * @file section_fwd.hpp
7  * @brief Forward declarations of Section, Node etc. to be included in translated MOD files.
8  */
9 struct Node;
10 struct Prop;
11 struct Section;
13 
14 // Forward declaration of Prop means Prop.id() not directly accessible
15 // in mod files. This helps work around that problem for purposes of validity
16 // checking. Perhaps someday, Prop will disappear entirely as it conceptually
17 // is just a mechanism row and is bloated with redundant type and size info.
18 // It does not exist in CoreNEURON.
20 
21 extern int cvode_active_;
22 extern int secondorder;
23 extern int use_sparse13;
24 
25 double nrn_ghk(double, double, double, double);
26 Datum* nrn_prop_datum_alloc(int type, int count, Prop* p);
27 
28 #if EXTRACELLULAR
29 /* pruned to only work with sparse13 */
30 extern int nrn_nlayer_extracellular;
31 #define nlayer (nrn_nlayer_extracellular) /* first (0) layer is extracellular next to membrane */
32 struct Extnode {
33  std::vector<neuron::container::data_handle<double>> param{};
34  // double* param; /* points to extracellular parameter vector */
35  /* v is membrane potential. so v internal = Node.v + Node.vext[0] */
36  /* However, the Node equation is for v internal. */
37  /* This is reconciled during update. */
38 
39  /* Following all have allocated size of nlayer */
40  double* v; /* v external. */
41  double* _a;
42  double* _b;
43  double** _d;
44  double** _rhs; /* d, rhs, a, and b are analogous to those in node */
45  double** _a_matelm;
46  double** _b_matelm;
47  double** _x12; /* effect of v[layer] on eqn layer-1 (or internal)*/
48  double** _x21; /* effect of v[layer-1 or internal] on eqn layer*/
49 };
50 #endif
51 
52 #define NODEA(n) _nrn_mechanism_access_a(n)
53 #define NODEB(n) _nrn_mechanism_access_b(n)
54 #define NODED(n) _nrn_mechanism_access_d(n)
55 #define NODERHS(n) _nrn_mechanism_access_rhs(n)
56 #ifdef NODEV
57 // Defined on macOS ("no device") at least
58 #undef NODEV
59 #endif
60 #define NODEV(n) _nrn_mechanism_access_voltage(n)
61 
62 /**
63  * A point process is computed just like regular mechanisms. Ie it appears in the property list
64  * whose type specifies which allocation, current, and state functions to call. This means some
65  * nodes have more properties than other nodes even in the same section. The Point_process structure
66  * allows the interface to hoc variable names. Each variable symbol u.rng->type refers to the point
67  * process mechanism. The variable is treated as a vector variable whose first index specifies
68  * "which one" of that mechanisms insertion points we are talking about. Finally the variable
69  * u.rng->index tells us where in the p-array to look. The number of point_process vectors is the
70  * number of different point process types. This is different from the mechanism type which
71  * enumerates all mechanisms including the point_processes. It is the responsibility of
72  * create_point_process to set up the vectors and fill in the symbol information. However only after
73  * the process is given a location can the variables be set or accessed. This is because the
74  * allocation function may have to connect to some ionic parameters and the process exists primarily
75  * as a property of a node.
76  */
77 struct Point_process {
78  Section* sec{}; /* section and node location for the point mechanism*/
79  Node* node{};
80  Prop* prop{}; /* pointer to the actual property linked to the
81  node property list */
82  Object* ob{}; /* object that owns this process */
83  void* presyn_{}; /* non-threshold presynapse for NetCon */
84  void* nvi_{}; /* NrnVarIntegrator (for local step method) */
85  void* _vnt{}; /* NrnThread* (for NET_RECEIVE and multicore) */
86 };
size_t p
short type
Definition: cabvars.h:10
double nrn_ghk(double, double, double, double)
Definition: eion.cpp:349
int nrn_nlayer_extracellular
Definition: extcelln.cpp:16
Datum * nrn_prop_datum_alloc(int type, int count, Prop *p)
Definition: cxprop.cpp:33
int cvode_active_
Definition: fadvance.cpp:144
neuron::container::non_owning_identifier_without_container _nrn_get_prop_id(Prop *)
Definition: membfunc.cpp:88
int use_sparse13
Definition: treeset.cpp:58
int secondorder
Definition: init.cpp:107
double ** _a_matelm
Definition: section_fwd.hpp:45
double ** _b_matelm
Definition: section_fwd.hpp:46
double * _b
Definition: section_fwd.hpp:42
double ** _x21
Definition: section_fwd.hpp:48
double ** _x12
Definition: section_fwd.hpp:47
std::vector< neuron::container::data_handle< double > > param
Definition: section_fwd.hpp:33
double * _a
Definition: section_fwd.hpp:41
double * v
Definition: section_fwd.hpp:40
double ** _d
Definition: section_fwd.hpp:43
double ** _rhs
Definition: section_fwd.hpp:44
Definition: section.h:105
Definition: hocdec.h:173
A point process is computed just like regular mechanisms.
Definition: section_fwd.hpp:77
Section * sec
Definition: section_fwd.hpp:78
Definition: section.h:231
Non-template stable handle to a generic value.
A non-owning permutation-stable identifier for an entry in a container.