Page 1 of 1

Using setpointer() and RXD concentrations

Posted: Mon Aug 26, 2019 6:16 pm
by amerg
I'm having an issue using setpointer() to connect a species concentration to a density mechanism. If I use a normal reference variable such as h._ref_t, then I don't get errors. However, if I use a line like

Code: Select all

h.setpointer(my_species.nodes(my_sec(0.5))[0]._ref_concentration, 'my_ptr', sec(0.5).mech_name)
I get these errors when the simulation tries to evaluate the line

Code: Select all

corrupted size vs. prev_size
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
I reformatted the mechanism to be a Point Process, but got the same error. Is there a mistake in how I'm trying to set the pointer?

Also, if I use a density mechanism, would I need to step through all of the segments and set each pointer to the concentrations of the appropriate nodes or are density mechanisms+pointers not supported/advised?

Re: Using setpointer() and RXD concentrations

Posted: Tue Aug 27, 2019 11:48 am
by adamjhn
The rxd Species, State and Parameter can be accessed in density mechanisms by their name. For example in the extracellular diffusion example;
The species has name='k', charge=1 which is accessed in steady_k.mod with

Code: Select all

Note the names have to match and the charge must equal the CHARGE (sometimes called VALENCE in nmodl).
Importantly, for intracellular regions, the region must be tagged with nrn_region='i' as the cyt region is in the varying initial concentrations and parameters example.

With a point process you will need to set the pointer, here is an mGluR example;
The Species Glu is linked to a pointer ā€˜Gā€™ in a point process that increases the concentration in response to stimulation.

Code: Select all

h.setpointer(Glu.nodes[0]._ref_concentration, 'G', syn)
As of 7.7.2 you can also set the pointer using;

Code: Select all

syn._ref_G = Glu.nodes[0]._ref_concentration