Skip to content
Snippets Groups Projects
Commit f9f34ccf authored by Sam Yates's avatar Sam Yates Committed by Benjamin Cumming
Browse files

Rejig weight and conversions for modcc (#800)

Address inconsistencies in unit conversions between current updates, initialization, ionic currents etc.

Fixes issues #793 and #798.

* Correct units in comments for ion state iX_ to a current density.
* Remove conversion factor for NMODL current densities [mA/cm²] to Arbor current densities [A/m²] from layout weight: from the point of view of Arbor, mechanisms now write in units that Arbor uses natively.
* Remove weight_ as a magic modcc variable; applying weight_ is now performed directly by code generated by printers.
* Change IndexedVariable interface: remove redundant index_name; remove 'op'. Whether external data is accumulated or assigned is now a property of the corresponding sourceKind.
* Conversion factors for NMODL <-> Arbor are collated in printerutils.cpp, determined by the external data sourceKind.
* Permit direct assignment of external data, as opposed to a weighted sum. This behaviour will be required for reversal potential handling.
* `current_` and `conducitivity_` get a different sourceKind in point mechanisms, allowing us to distinguish current contributions from current density contributions (and applying correct unit scaling accordingly.)
* Add unit test for correct initialization and scaling of ionic currents, together with two corresponding unit test mechanisms.
parent c73feec5
No related branches found
No related tags found
No related merge requests found
Showing
with 446 additions and 249 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment