39 #define execerror hoc_execerror
101 #define NODEAREA(n) ((n)->area())
102 #define NODERINV(n) ((n)->_rinv)
111 [[nodiscard]]
auto id() {
114 [[nodiscard]]
auto&
a() {
117 [[nodiscard]]
auto const&
a()
const {
123 [[nodiscard]]
auto const&
area()
const {
129 [[nodiscard]]
auto&
b() {
132 [[nodiscard]]
auto const&
b()
const {
135 [[nodiscard]]
auto&
d() {
138 [[nodiscard]]
auto const&
d()
const {
141 [[nodiscard]]
auto&
v() {
144 [[nodiscard]]
auto const&
v()
const {
150 [[nodiscard]]
auto const&
v_hack()
const {
156 [[nodiscard]]
auto&
rhs() {
159 [[nodiscard]]
auto const&
rhs()
const {
168 [[nodiscard]]
auto const&
sav_d()
const {
203 Eqnblock* eqnblock{};
221 return os <<
n._node_handle;
230 #define PROP_PY_INDEX 10
256 [[nodiscard]]
auto id()
const {
267 auto*
const raw_ptr =
static_cast<double const*
>(
handle);
268 for (
auto i = 0;
i < num_fpfields; ++
i) {
294 [[nodiscard]]
double&
param(
int field_index,
int array_index = 0) {
304 [[nodiscard]]
double const&
param(
int field_index,
int array_index = 0)
const {
334 if (legacy_index < total + array_dim) {
335 auto const array_index = legacy_index - total;
336 return {
field, array_index};
340 throw std::runtime_error(
"could not translate legacy index " +
347 return param(array_dim, array_index);
352 return param(array_dim, array_index);
396 if (
p.m_mech_handle) {
397 return os << *
p.m_mech_handle;
399 return os <<
"Prop{nullopt}";
421 typedef struct Eqnblock {
422 struct Eqnblock* eqnblock_next;
423 Pfri eqnblock_triang;
425 double* eqnblock_data;
429 double *eqnblock_row;
430 double *eqnblock_col;
431 double *eqnblock_matrix;
432 double *eqnblock_rhs:
435 The
interface with
EXTRACELLULAR makes things a bit more subtle.
436 It seems clear that we will have to change the meaning of
v to
438 This will avoid requiring
two rows and
two columns since
439 the state equations will depend only on
v and not vext.
440 In fact,
if vext did not have longitudinal relationships with
441 other vext the extracellular
mechanism could be implemented in
461 #define tstopbit (1 << 15)
462 #define tstopset stoprun |= tstopbit
463 #define tstopunset stoprun &= (~tstopbit)
static double order(void *v)
static VoidFunc functions[]
static const char * mechanism[]
void update(NrnThread *_nt)
handle_interface< non_owning_identifier< storage > > handle
Non-owning handle to a Mechanism instance.
Model & model()
Access the global Model instance.
std::string to_string(const T &obj)
static Node * node(Object *)
int const size_t const size_t n
static double take(void *v)
int find(const int, const int, const int, const int, const int)
void node_alloc(Section *, short)
struct Info3Coef Info3Coef
int nrn_is_valid_section_ptr(void *)
void nrn_prop_datum_free(int type, Datum *ppd)
Node * nrn_parent_node(Node *)
void nrn_section_free(Section *)
int nrn_mechanism_prop_datum_count(int type)
Section * sec_alloc()
Allocate a new Section object.
Section * nrn_section_alloc()
void nrn_delete_mechanism_prop_datum(int type)
Forward declarations of Section, Node etc.
auto const & v_hack() const
struct Node * _classical_parent
auto const & sav_d() const
auto const & sav_rhs() const
auto const & area() const
neuron::container::Node::owning_handle _node_handle
Node & operator=(Node &&)=default
Node & operator=(Node const &)=delete
friend std::ostream & operator<<(std::ostream &os, Node const &n)
Node(Node const &)=delete
Represent main neuron object computed by single thread.
int param_num_vars() const
Return how many (possibly-array) variables are associated with this Prop.
int param_array_dimension(int field) const
Return the array dimension of the given value.
double const & param(int field_index, int array_index=0) const
Return a reference to the i-th double value associated with this Prop.
auto id() const
Get the identifier of this instance.
double & param(int field_index, int array_index=0)
Return a reference to the i-th floating point data field associated with this Prop.
auto param_handle(neuron::container::field_index ind)
auto param_handle_legacy(int legacy_index)
friend std::ostream & operator<<(std::ostream &os, Prop const &p)
auto param_handle(int field, int array_index=0)
Return a handle to the i-th double value associated with this Prop.
bool owns(neuron::container::data_handle< double > const &handle) const
Check if the given handle refers to data owned by this Prop.
std::size_t current_row() const
int param_size() const
Return how many double values are assocated with this Prop.
std::pair< int, int > translate_legacy_index(int legacy_index) const
Translate a legacy (flat) index into a (variable, array offset) pair.
double & param_legacy(int legacy_index)
double const & param_legacy(int legacy_index) const
std::optional< neuron::container::Mechanism::owning_handle > m_mech_handle
Prop(Node *node, short type)
Pt3d * logical_connection
container::Mechanism::storage & mechanism_data(int type)
Get the structure holding the data of a particular Mechanism.
container::Node::storage & node_data()
Access the structure containing the data of all Nodes.
Base class defining the public API of Mechanism handles.
field::Diagonal::type & d()
Return the diagonal element.
data_handle< field::RHS::type > rhs_handle()
Return a handle to the right hand side of the Hines solver.
field::RHS::type & rhs()
Return the right hand side of the Hines solver.
field::BelowDiagonal::type & b()
Return the below-diagonal element.
field::Voltage::type & v_hack()
This is a workaround for v sometimes being a macro.
data_handle< field::FastIMemSavRHS::type > sav_rhs_handle()
field::AboveDiagonal::type & a()
Return the above-diagonal element.
field::FastIMemSavRHS::type & sav_rhs()
field::Area::type & area_hack()
This is a workaround for area sometimes being a macro.
field::FastIMemSavRHS::type & sav_d()
data_handle< field::Voltage::type > v_handle()
Return a handle to the membrane potential.
data_handle< field::Area::type > area_handle()
Return a data_handle to the area.
handle non_owning_handle()
Get a non-owning handle from an owning handle.
Struct used to index SoAoS data, such as array range variables.
Non-template stable handle to a generic value.
non_owning_identifier_without_container id() const
Obtain a lightweight identifier of the current entry.