Extend cable cell probe variety. (#1034)
Fixes #589 and #730, providing cell-wide probes and a correct total trans-membrane current. Fixes #822, providing spatial interpolation of membrane voltages as governed by cable resistivity and diameter. * Add partition of point mechanism target vector by cell index to `fvm_mechanism_config`. * Fix sign error in axial current interpolation. * Replace `fvm_probe_info` with class that wraps a variant type capturing one of a set of backend-cellgroup probe translation representations: `fvm_probe_scalar`, `fvm_probe_interpolated`, `fvm_probe_multi`, `fvm_probe_weighted_multi`, `fvm_probe_membrance_currents`. * Refactor `fvm_lowered_cell_impl::resolve_probe_address` so that it avoids the long chain of if-else tests on wrapped `any` type with an invocation of `util::any_visitor`. Each specific cable cell probe address representation is translated into one of the intermediate `fvm_probe_info` variants via an overload of `resolve_probe`. * Add new non-scalar cell probe address types for all-of-cell values, including point mechanism state, density mechanism state, ion currents and concentrations, membrane voltage by CV cable, and total trans-mebrane currents. The latter are ultimately calculated by computing the net axial current fluxes in each CV. * Add `util::any_ptr` field to the sampling function interface, pointing to constant-per-simulation-run metadata associated with a probe address. Underlying metadata type varies between probe types. * Extend `simple_sampler` so that it optionally captures sampler metadata. * Add special case to `simple_sampler` for vector-valued sample data, allowing it to translate from a pointer-pair range to a std::vector. * Fix minor bugs in `util::variant`. * Add to `mc_cell_group` the logic for translating each intermediate probe representation to a sampler callback invocation, reusing temporary scratch vectors across calls. * Add unit comments to `embed_pwlin_data`. * Add probe variety demonstration `probe-demo` to examples, covering most of the new cable cell probe classes. * Add `util::any_visitor` runtime-type dependent dispatcher class. * Add `util::overload` helper for generating overloaded functional objects from individual functions, lambdas or functionals. * Extend probe unit tests in `test_probe.cpp` to cover new probe address types. * Add unit tests for `any_visitor` and `overload`.
Showing
- arbor/backends/gpu/fvm.hpp 1 addition, 0 deletionsarbor/backends/gpu/fvm.hpp
- arbor/backends/multicore/fvm.hpp 1 addition, 0 deletionsarbor/backends/multicore/fvm.hpp
- arbor/fvm_layout.cpp 35 additions, 11 deletionsarbor/fvm_layout.cpp
- arbor/fvm_layout.hpp 5 additions, 1 deletionarbor/fvm_layout.hpp
- arbor/fvm_lowered_cell.hpp 98 additions, 7 deletionsarbor/fvm_lowered_cell.hpp
- arbor/fvm_lowered_cell_impl.hpp 352 additions, 91 deletionsarbor/fvm_lowered_cell_impl.hpp
- arbor/include/arbor/cable_cell.hpp 116 additions, 13 deletionsarbor/include/arbor/cable_cell.hpp
- arbor/include/arbor/sampling.hpp 7 additions, 1 deletionarbor/include/arbor/sampling.hpp
- arbor/include/arbor/simple_sampler.hpp 75 additions, 10 deletionsarbor/include/arbor/simple_sampler.hpp
- arbor/include/arbor/util/any_visitor.hpp 155 additions, 0 deletionsarbor/include/arbor/util/any_visitor.hpp
- arbor/include/arbor/util/variant.hpp 2 additions, 5 deletionsarbor/include/arbor/util/variant.hpp
- arbor/mc_cell_group.cpp 254 additions, 21 deletionsarbor/mc_cell_group.cpp
- arbor/mc_cell_group.hpp 1 addition, 1 deletionarbor/mc_cell_group.hpp
- arbor/morph/embed_pwlin.cpp 5 additions, 5 deletionsarbor/morph/embed_pwlin.cpp
- doc/cpp_cable_cell.rst 303 additions, 0 deletionsdoc/cpp_cable_cell.rst
- doc/sampling_api.rst 9 additions, 4 deletionsdoc/sampling_api.rst
- example/CMakeLists.txt 1 addition, 0 deletionsexample/CMakeLists.txt
- example/dryrun/dryrun.cpp 3 additions, 3 deletionsexample/dryrun/dryrun.cpp
- example/gap_junctions/gap_junctions.cpp 1 addition, 1 deletionexample/gap_junctions/gap_junctions.cpp
- example/generators/generators.cpp 8 additions, 7 deletionsexample/generators/generators.cpp
Please register or sign in to comment