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.
Showing
- arbor/backends/gpu/shared_state.hpp 1 addition, 1 deletionarbor/backends/gpu/shared_state.hpp
- arbor/backends/multicore/shared_state.hpp 1 addition, 1 deletionarbor/backends/multicore/shared_state.hpp
- arbor/fvm_lowered_cell_impl.hpp 2 additions, 3 deletionsarbor/fvm_lowered_cell_impl.hpp
- modcc/blocks.hpp 0 additions, 5 deletionsmodcc/blocks.hpp
- modcc/expression.cpp 4 additions, 3 deletionsmodcc/expression.cpp
- modcc/expression.hpp 8 additions, 31 deletionsmodcc/expression.hpp
- modcc/identifier.hpp 29 additions, 2 deletionsmodcc/identifier.hpp
- modcc/memop.hpp 0 additions, 39 deletionsmodcc/memop.hpp
- modcc/module.cpp 24 additions, 65 deletionsmodcc/module.cpp
- modcc/printer/cprinter.cpp 112 additions, 61 deletionsmodcc/printer/cprinter.cpp
- modcc/printer/cprinter.hpp 0 additions, 2 deletionsmodcc/printer/cprinter.hpp
- modcc/printer/cudaprinter.cpp 38 additions, 19 deletionsmodcc/printer/cudaprinter.cpp
- modcc/printer/cudaprinter.hpp 0 additions, 1 deletionmodcc/printer/cudaprinter.hpp
- modcc/printer/printerutil.cpp 49 additions, 16 deletionsmodcc/printer/printerutil.cpp
- modcc/printer/printerutil.hpp 7 additions, 0 deletionsmodcc/printer/printerutil.hpp
- test/unit/CMakeLists.txt 3 additions, 0 deletionstest/unit/CMakeLists.txt
- test/unit/mod/fixed_ica_current.mod 24 additions, 0 deletionstest/unit/mod/fixed_ica_current.mod
- test/unit/mod/linear_ca_conc.mod 30 additions, 0 deletionstest/unit/mod/linear_ca_conc.mod
- test/unit/mod/point_ica_current.mod 24 additions, 0 deletionstest/unit/mod/point_ica_current.mod
- test/unit/test_fvm_lowered.cpp 90 additions, 0 deletionstest/unit/test_fvm_lowered.cpp
Please register or sign in to comment