diff --git a/arbor/CMakeLists.txt b/arbor/CMakeLists.txt index e54d2d5089268661911881efcee00ec720d49c34..936aa2d9a3a5196cdd0243a908c09ac4381aa2d4 100644 --- a/arbor/CMakeLists.txt +++ b/arbor/CMakeLists.txt @@ -21,7 +21,7 @@ set(arbor_sources io/locked_ostream.cpp io/serialize_hex.cpp lif_cell_group.cpp - mc_cell.cpp + cable_cell.cpp mc_cell_group.cpp mechcat.cpp memory/cuda_wrappers.cpp diff --git a/arbor/mc_cell.cpp b/arbor/cable_cell.cpp similarity index 61% rename from arbor/mc_cell.cpp rename to arbor/cable_cell.cpp index 5807afd0dafa9f6b26ed783392c90b8f58b42c33..dd831a11743225f78c866ddc1462b732a90ebb7e 100644 --- a/arbor/mc_cell.cpp +++ b/arbor/cable_cell.cpp @@ -1,28 +1,28 @@ -#include <arbor/mc_cell.hpp> -#include <arbor/mc_segment.hpp> +#include <arbor/cable_cell.hpp> +#include <arbor/segment.hpp> #include <arbor/morphology.hpp> #include "util/rangeutil.hpp" namespace arb { -using value_type = mc_cell::value_type; -using index_type = mc_cell::index_type; -using size_type = mc_cell::size_type; +using value_type = cable_cell::value_type; +using index_type = cable_cell::index_type; +using size_type = cable_cell::size_type; -mc_cell::mc_cell() { +cable_cell::cable_cell() { // insert a placeholder segment for the soma segments_.push_back(make_segment<placeholder_segment>()); parents_.push_back(0); } -void mc_cell::assert_valid_segment(index_type i) const { +void cable_cell::assert_valid_segment(index_type i) const { if (i>=num_segments()) { - throw mc_cell_error("no such segment"); + throw cable_cell_error("no such segment"); } } -size_type mc_cell::num_segments() const { +size_type cable_cell::num_segments() const { return segments_.size(); } @@ -30,21 +30,21 @@ size_type mc_cell::num_segments() const { // note: I think that we have to enforce that the soma is the first // segment that is added // -soma_segment* mc_cell::add_soma(value_type radius, point_type center) { +soma_segment* cable_cell::add_soma(value_type radius, point_type center) { if (has_soma()) { - throw mc_cell_error("cell already has soma"); + throw cable_cell_error("cell already has soma"); } segments_[0] = make_segment<soma_segment>(radius, center); return segments_[0]->as_soma(); } -cable_segment* mc_cell::add_cable(index_type parent, mc_segment_ptr&& cable) { +cable_segment* cable_cell::add_cable(index_type parent, segment_ptr&& cable) { if (!cable->as_cable()) { - throw mc_cell_error("segment is not a cable segment"); + throw cable_cell_error("segment is not a cable segment"); } if (parent>num_segments()) { - throw mc_cell_error("parent index out of range"); + throw cable_cell_error("parent index out of range"); } segments_.push_back(std::move(cable)); @@ -53,35 +53,35 @@ cable_segment* mc_cell::add_cable(index_type parent, mc_segment_ptr&& cable) { return segments_.back()->as_cable(); } -mc_segment* mc_cell::segment(index_type index) { +segment* cable_cell::segment(index_type index) { assert_valid_segment(index); return segments_[index].get(); } -mc_segment const* mc_cell::segment(index_type index) const { +segment const* cable_cell::segment(index_type index) const { assert_valid_segment(index); return segments_[index].get(); } -bool mc_cell::has_soma() const { +bool cable_cell::has_soma() const { return !segment(0)->is_placeholder(); } -soma_segment* mc_cell::soma() { +soma_segment* cable_cell::soma() { return has_soma()? segment(0)->as_soma(): nullptr; } -const soma_segment* mc_cell::soma() const { +const soma_segment* cable_cell::soma() const { return has_soma()? segment(0)->as_soma(): nullptr; } -cable_segment* mc_cell::cable(index_type index) { +cable_segment* cable_cell::cable(index_type index) { assert_valid_segment(index); auto cable = segment(index)->as_cable(); - return cable? cable: throw mc_cell_error("segment is not a cable segment"); + return cable? cable: throw cable_cell_error("segment is not a cable segment"); } -std::vector<size_type> mc_cell::compartment_counts() const { +std::vector<size_type> cable_cell::compartment_counts() const { std::vector<size_type> comp_count; comp_count.reserve(num_segments()); for (const auto& s: segments()) { @@ -90,26 +90,26 @@ std::vector<size_type> mc_cell::compartment_counts() const { return comp_count; } -size_type mc_cell::num_compartments() const { +size_type cable_cell::num_compartments() const { return util::sum_by(segments_, - [](const mc_segment_ptr& s) { return s->num_compartments(); }); + [](const segment_ptr& s) { return s->num_compartments(); }); } -void mc_cell::add_stimulus(segment_location loc, i_clamp stim) { +void cable_cell::add_stimulus(segment_location loc, i_clamp stim) { (void)segment(loc.segment); // assert loc.segment in range stimuli_.push_back({loc, std::move(stim)}); } -void mc_cell::add_detector(segment_location loc, double threshold) { +void cable_cell::add_detector(segment_location loc, double threshold) { spike_detectors_.push_back({loc, threshold}); } // Construct cell from flat morphology specification. -mc_cell make_mc_cell(const morphology& morph, bool compartments_from_discretization) { - using point3d = mc_cell::point_type; - mc_cell newcell; +cable_cell make_cable_cell(const morphology& morph, bool compartments_from_discretization) { + using point3d = cable_cell::point_type; + cable_cell newcell; if (!morph) { return newcell; @@ -127,7 +127,7 @@ mc_cell make_mc_cell(const morphology& morph, bool compartments_from_discretizat kind = section_kind::dendrite; break; case section_kind::soma: - throw mc_cell_error("no support for complex somata"); + throw cable_cell_error("no support for complex somata"); break; default: ; } diff --git a/arbor/cell_group_factory.cpp b/arbor/cell_group_factory.cpp index e3dc6a749d9a26dbfaf8db855e81e0ccdbb81c9d..68f3f9a294f15d3a1b1df92afd88d8e2a576a2a2 100644 --- a/arbor/cell_group_factory.cpp +++ b/arbor/cell_group_factory.cpp @@ -25,7 +25,7 @@ cell_group_factory cell_kind_implementation( using gid_vector = std::vector<cell_gid_type>; switch (ck) { - case cell_kind::cable1d_neuron: + case cell_kind::cable: return [bk, ctx](const gid_vector& gids, const recipe& rec) { return make_cell_group<mc_cell_group>(gids, rec, make_fvm_lowered_cell(bk, ctx)); }; @@ -37,7 +37,7 @@ cell_group_factory cell_kind_implementation( return make_cell_group<spike_source_cell_group>(gids, rec); }; - case cell_kind::lif_neuron: + case cell_kind::lif: if (bk!=backend_kind::multicore) break; return [](const gid_vector& gids, const recipe& rec) { diff --git a/arbor/common_types_io.cpp b/arbor/common_types_io.cpp index c5b904784f700af08d78c8805a04728cf096001d..c08d0b66f614ca0ce5ca1d314fd95717dc4e11ac 100644 --- a/arbor/common_types_io.cpp +++ b/arbor/common_types_io.cpp @@ -13,10 +13,10 @@ std::ostream& operator<<(std::ostream& o, arb::cell_kind k) { switch (k) { case arb::cell_kind::spike_source: return o << "spike_source"; - case arb::cell_kind::cable1d_neuron: - return o << "cable1d_neuron"; - case arb::cell_kind::lif_neuron: - return o << "lif_neuron"; + case arb::cell_kind::cable: + return o << "cable"; + case arb::cell_kind::lif: + return o << "lif"; case arb::cell_kind::benchmark: return o << "benchmark_cell"; } diff --git a/arbor/fvm_layout.cpp b/arbor/fvm_layout.cpp index 7e43669cd0336c7bdb5e50cba64be1ce0fd114a5..1612734baf6d208745bada5e1a0488dcc7149c49 100644 --- a/arbor/fvm_layout.cpp +++ b/arbor/fvm_layout.cpp @@ -4,7 +4,7 @@ #include <vector> #include <arbor/arbexcept.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include "algorithms.hpp" #include "fvm_compartment.hpp" @@ -39,7 +39,7 @@ namespace { std::vector<tree::int_type> parent_index; std::vector<tree::int_type> segment_index; - explicit compartment_model(const mc_cell& cell) { + explicit compartment_model(const cable_cell& cell) { tree = arb::tree(cell.parents()); auto counts = cell.compartment_counts(); parent_index = make_parent_index(tree, counts); @@ -118,7 +118,7 @@ namespace { // = 1/R · hVâ‚Vâ‚‚/(h₂²Vâ‚+h₲Vâ‚‚) // -fvm_discretization fvm_discretize(const std::vector<mc_cell>& cells) { +fvm_discretization fvm_discretize(const std::vector<cable_cell>& cells) { using value_type = fvm_value_type; using index_type = fvm_index_type; @@ -127,11 +127,11 @@ fvm_discretization fvm_discretize(const std::vector<mc_cell>& cells) { fvm_discretization D; util::make_partition(D.cell_segment_bounds, - transform_view(cells, [](const mc_cell& c) { return c.num_segments(); })); + transform_view(cells, [](const cable_cell& c) { return c.num_segments(); })); std::vector<index_type> cell_comp_bounds; auto cell_comp_part = make_partition(cell_comp_bounds, - transform_view(cells, [](const mc_cell& c) { return c.num_compartments(); })); + transform_view(cells, [](const cable_cell& c) { return c.num_compartments(); })); D.ncell = cells.size(); D.ncomp = cell_comp_part.bounds().second; @@ -160,7 +160,7 @@ fvm_discretization fvm_discretize(const std::vector<mc_cell>& cells) { seg_comp_bounds.clear(); auto seg_comp_part = make_partition( seg_comp_bounds, - transform_view(c.segments(), [](const mc_segment_ptr& s) { return s->num_compartments(); }), + transform_view(c.segments(), [](const segment_ptr& s) { return s->num_compartments(); }), cell_comp_base); const auto nseg = seg_comp_part.size(); @@ -257,7 +257,7 @@ fvm_discretization fvm_discretize(const std::vector<mc_cell>& cells) { // IIb. Density mechanism CVs, parameter values; ion channel default concentration contributions. // IIc. Point mechanism CVs, parameter values, and targets. -fvm_mechanism_data fvm_build_mechanism_data(const mechanism_catalogue& catalogue, const std::vector<mc_cell>& cells, const fvm_discretization& D, bool coalesce_syanpses) { +fvm_mechanism_data fvm_build_mechanism_data(const mechanism_catalogue& catalogue, const std::vector<cable_cell>& cells, const fvm_discretization& D, bool coalesce_syanpses) { using util::assign; using util::sort_by; using util::optional; diff --git a/arbor/fvm_layout.hpp b/arbor/fvm_layout.hpp index abf7389e2dc1fb3c33f00406ae9ab29fa4dadd35..459fb5136e46ec2540355c6b8c9ab56a7198d16b 100644 --- a/arbor/fvm_layout.hpp +++ b/arbor/fvm_layout.hpp @@ -1,7 +1,7 @@ #pragma once #include <arbor/fvm_types.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/mechanism.hpp> #include <arbor/mechinfo.hpp> #include <arbor/mechcat.hpp> @@ -87,7 +87,7 @@ struct fvm_discretization { } }; -fvm_discretization fvm_discretize(const std::vector<mc_cell>& cells); +fvm_discretization fvm_discretize(const std::vector<cable_cell>& cells); // Post-discretization data for point and density mechanism instantiation. @@ -140,6 +140,6 @@ struct fvm_mechanism_data { std::size_t ntarget = 0; }; -fvm_mechanism_data fvm_build_mechanism_data(const mechanism_catalogue& catalogue, const std::vector<mc_cell>& cells, const fvm_discretization& D, bool coalesce = true); +fvm_mechanism_data fvm_build_mechanism_data(const mechanism_catalogue& catalogue, const std::vector<cable_cell>& cells, const fvm_discretization& D, bool coalesce = true); } // namespace arb diff --git a/arbor/fvm_lowered_cell_impl.hpp b/arbor/fvm_lowered_cell_impl.hpp index 15d95a44944f7224c80ce4769b3bf17754236a98..b1cb1ff9c3932d32c96ea6395c472e7d1c704d1f 100644 --- a/arbor/fvm_lowered_cell_impl.hpp +++ b/arbor/fvm_lowered_cell_impl.hpp @@ -64,7 +64,7 @@ public: std::vector<sample_event> staged_samples) override; std::vector<fvm_gap_junction> fvm_gap_junctions( - const std::vector<mc_cell>& cells, + const std::vector<cable_cell>& cells, const std::vector<cell_gid_type>& gids, const recipe& rec, const fvm_discretization& D); @@ -333,28 +333,28 @@ void fvm_lowered_cell_impl<B>::initialize( set_gpu(); - std::vector<mc_cell> cells; + std::vector<cable_cell> cells; const std::size_t ncell = gids.size(); cells.reserve(ncell); for (auto gid: gids) { try { - cells.push_back(any_cast<mc_cell>(rec.get_cell_description(gid))); + cells.push_back(any_cast<cable_cell>(rec.get_cell_description(gid))); } catch (util::bad_any_cast&) { throw bad_cell_description(rec.get_cell_kind(gid), gid); } } - mc_cell_global_properties global_props; + cable_cell_global_properties global_props; try { - util::any rec_props = rec.get_global_properties(cell_kind::cable1d_neuron); + util::any rec_props = rec.get_global_properties(cell_kind::cable); if (rec_props.has_value()) { - global_props = any_cast<mc_cell_global_properties>(rec_props); + global_props = any_cast<cable_cell_global_properties>(rec_props); } } catch (util::bad_any_cast&) { - throw bad_global_property(cell_kind::cable1d_neuron); + throw bad_global_property(cell_kind::cable); } const mechanism_catalogue* catalogue = global_props.catalogue; @@ -509,7 +509,7 @@ void fvm_lowered_cell_impl<B>::initialize( // Get vector of gap_junctions template <typename B> std::vector<fvm_gap_junction> fvm_lowered_cell_impl<B>::fvm_gap_junctions( - const std::vector<mc_cell>& cells, + const std::vector<cable_cell>& cells, const std::vector<cell_gid_type>& gids, const recipe& rec, const fvm_discretization& D) { @@ -533,7 +533,7 @@ std::vector<fvm_gap_junction> fvm_lowered_cell_impl<B>::fvm_gap_junctions( auto gj_list = rec.gap_junctions_on(gid); for (auto g: gj_list) { if (gid != g.local.gid && gid != g.peer.gid) { - throw arb::bad_cell_description(cell_kind::cable1d_neuron, gid); + throw arb::bad_cell_description(cell_kind::cable, gid); } cell_gid_type cv0, cv1; try { @@ -541,7 +541,7 @@ std::vector<fvm_gap_junction> fvm_lowered_cell_impl<B>::fvm_gap_junctions( cv1 = gid_to_cvs[g.peer.gid].at(g.peer.index); } catch (std::out_of_range&) { - throw arb::bad_cell_description(cell_kind::cable1d_neuron, gid); + throw arb::bad_cell_description(cell_kind::cable, gid); } if (gid != g.local.gid) { std::swap(cv0, cv1); @@ -585,7 +585,7 @@ fvm_size_type fvm_lowered_cell_impl<B>::fvm_intdom( cell_gid_type peer = gj.local.gid==g? gj.peer.gid: gj.peer.gid==g? gj.local.gid: - throw bad_cell_description(cell_kind::cable1d_neuron, g); + throw bad_cell_description(cell_kind::cable, g); if (!gid_to_loc.count(peer)) { throw gj_unsupported_domain_decomposition(g, peer); diff --git a/arbor/include/arbor/mc_cell.hpp b/arbor/include/arbor/cable_cell.hpp similarity index 87% rename from arbor/include/arbor/mc_cell.hpp rename to arbor/include/arbor/cable_cell.hpp index 82aa8cb58e806e1111619ef256b6c2543363f42c..dd865de8cb4b0c90ac570c1079b2570f6c0024f8 100644 --- a/arbor/include/arbor/mc_cell.hpp +++ b/arbor/include/arbor/cable_cell.hpp @@ -10,15 +10,15 @@ #include <arbor/ion.hpp> #include <arbor/mechcat.hpp> #include <arbor/morphology.hpp> -#include <arbor/mc_segment.hpp> +#include <arbor/segment.hpp> namespace arb { // Specialize arbor exception for errors in cell building. -struct mc_cell_error: arbor_exception { - mc_cell_error(const std::string& what): - arbor_exception("mc_cell: "+what) +struct cable_cell_error: arbor_exception { + cable_cell_error(const std::string& what): + arbor_exception("cable_cell: "+what) {} }; @@ -66,7 +66,7 @@ struct cell_probe_address { // Global parameter type for cell descriptions. -struct mc_cell_global_properties { +struct cable_cell_global_properties { const mechanism_catalogue* catalogue = &global_default_catalogue(); // If >0, check membrane voltage magnitude is less than limit @@ -94,7 +94,7 @@ struct mc_cell_global_properties { }; /// high-level abstract representation of a cell and its segments -class mc_cell { +class cable_cell { public: using index_type = cell_lid_type; using size_type = cell_local_size_type; @@ -119,10 +119,10 @@ public: }; /// Default constructor - mc_cell(); + cable_cell(); /// Copy constructor - mc_cell(const mc_cell& other): + cable_cell(const cable_cell& other): parents_(other.parents_), stimuli_(other.stimuli_), synapses_(other.synapses_), @@ -137,11 +137,11 @@ public: } /// Move constructor - mc_cell(mc_cell&& other) = default; + cable_cell(cable_cell&& other) = default; /// Return the kind of cell, used for grouping into cell_groups cell_kind get_cell_kind() const { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } /// add a soma to the cell @@ -151,7 +151,7 @@ public: /// add a cable /// parent is the index of the parent segment for the cable section /// cable is the segment that will be moved into the cell - cable_segment* add_cable(index_type parent, mc_segment_ptr&& cable); + cable_segment* add_cable(index_type parent, segment_ptr&& cable); /// add a cable by constructing it in place /// parent is the index of the parent segment for the cable section @@ -164,8 +164,8 @@ public: bool has_soma() const; - class mc_segment* segment(index_type index); - const class mc_segment* segment(index_type index) const; + class segment* segment(index_type index); + const class segment* segment(index_type index) const; /// access pointer to the soma /// returns nullptr if the cell has no soma @@ -173,14 +173,14 @@ public: const soma_segment* soma() const; /// access pointer to a cable segment - /// will throw an mc_cell_error exception if + /// will throw an cable_cell_error exception if /// the cable index is not valid cable_segment* cable(index_type index); /// the total number of compartments over all segments size_type num_compartments() const; - std::vector<mc_segment_ptr> const& segments() const { + std::vector<segment_ptr> const& segments() const { return segments_; } @@ -244,7 +244,7 @@ public: // - volume and area properties of each segment // - number of compartments in each segment // (note: just used for testing: move to test code?) - friend bool cell_basic_equality(const mc_cell&, const mc_cell&); + friend bool cell_basic_equality(const cable_cell&, const cable_cell&); // Public view of parent indices vector. const std::vector<index_type>& parents() const { @@ -258,7 +258,7 @@ private: std::vector<index_type> parents_; // the segments - std::vector<mc_segment_ptr> segments_; + std::vector<segment_ptr> segments_; // the stimuli std::vector<stimulus_instance> stimuli_; @@ -275,11 +275,11 @@ private: // create a cable by forwarding cable construction parameters provided by the user template <typename... Args> -cable_segment* mc_cell::add_cable(mc_cell::index_type parent, Args&&... args) +cable_segment* cable_cell::add_cable(cable_cell::index_type parent, Args&&... args) { // check for a valid parent id if (parent>=num_segments()) { - throw mc_cell_error("parent index of cell segment is out of range"); + throw cable_cell_error("parent index of cell segment is out of range"); } segments_.push_back(make_segment<cable_segment>(std::forward<Args>(args)...)); parents_.push_back(parent); @@ -291,6 +291,6 @@ cable_segment* mc_cell::add_cable(mc_cell::index_type parent, Args&&... args) // If compartments_from_discretization is true, set number of compartments in // each segment to be the number of piecewise linear sections in the corresponding // section of the morphologu. -mc_cell make_mc_cell(const morphology&, bool compartments_from_discretization=false); +cable_cell make_cable_cell(const morphology&, bool compartments_from_discretization=false); } // namespace arb diff --git a/arbor/include/arbor/common_types.hpp b/arbor/include/arbor/common_types.hpp index 418ba7865b5e18ce8cafabfcd0d506fb7b78ceee..3741f120119c3ad596af592cf6e1a23ea743db22 100644 --- a/arbor/include/arbor/common_types.hpp +++ b/arbor/include/arbor/common_types.hpp @@ -75,8 +75,8 @@ enum class backend_kind { // group equal kinds in the same cell group. enum class cell_kind { - cable1d_neuron, // Our own special mc neuron. - lif_neuron, // Leaky-integrate and fire neuron. + cable, // Our own special mc neuron. + lif, // Leaky-integrate and fire neuron. spike_source, // Cell that generates spikes at a user-supplied sequence of time points. benchmark, // Proxy cell used for benchmarking. }; diff --git a/arbor/include/arbor/mc_segment.hpp b/arbor/include/arbor/segment.hpp similarity index 91% rename from arbor/include/arbor/mc_segment.hpp rename to arbor/include/arbor/segment.hpp index ded52d54857d6a57f7ab98dc0eddabc7c4a00492..1f408850f1b0757a6e30fa49d22c8343cf0f48b2 100644 --- a/arbor/include/arbor/mc_segment.hpp +++ b/arbor/include/arbor/segment.hpp @@ -77,14 +77,14 @@ class soma_segment; class cable_segment; // abstract base class for a cell segment -class mc_segment { +class segment { public: using value_type = double; using size_type = cell_local_size_type; using point_type = point<value_type>; // (Yet more motivation for a separate morphology description class!) - virtual std::unique_ptr<mc_segment> clone() const = 0; + virtual std::unique_ptr<segment> clone() const = 0; section_kind kind() const { return kind_; @@ -108,7 +108,7 @@ public: virtual size_type num_compartments() const = 0; virtual void set_compartments(size_type) = 0; - virtual ~mc_segment() = default; + virtual ~segment() = default; virtual cable_segment* as_cable() { @@ -169,17 +169,17 @@ public: value_type cm = 0.01; // capacitance [F/m^2] : 10 nF/mm^2 = 0.01 F/m^2 protected: - mc_segment(section_kind kind): kind_(kind) {} + segment(section_kind kind): kind_(kind) {} section_kind kind_; std::vector<mechanism_desc> mechanisms_; }; -class placeholder_segment : public mc_segment { +class placeholder_segment : public segment { public: - placeholder_segment(): mc_segment(section_kind::none) {} + placeholder_segment(): segment(section_kind::none) {} - std::unique_ptr<mc_segment> clone() const override { + std::unique_ptr<segment> clone() const override { // use default copy constructor return std::make_unique<placeholder_segment>(*this); } @@ -197,14 +197,14 @@ public: virtual void set_compartments(size_type) override {} }; -class soma_segment : public mc_segment { +class soma_segment : public segment { public: soma_segment() = delete; explicit soma_segment(value_type r, point_type c = point_type{}): - mc_segment(section_kind::soma), radius_{r}, center_(c) {} + segment(section_kind::soma), radius_{r}, center_(c) {} - std::unique_ptr<mc_segment> clone() const override { + std::unique_ptr<segment> clone() const override { // use default copy constructor return std::make_unique<soma_segment>(*this); } @@ -244,9 +244,9 @@ private : point_type center_; }; -class cable_segment : public mc_segment { +class cable_segment : public segment { public: - using base = mc_segment; + using base = segment; using base::kind_; using base::value_type; using base::point_type; @@ -256,7 +256,7 @@ public: // constructors for a cable with no location information cable_segment(section_kind k, std::vector<value_type> r, std::vector<value_type> lens): - mc_segment(k), radii_(std::move(r)), lengths_(std::move(lens)) + segment(k), radii_(std::move(r)), lengths_(std::move(lens)) { arb_assert(kind_==section_kind::dendrite || kind_==section_kind::axon); } @@ -268,7 +268,7 @@ public: // constructor that lets the user describe the cable as a // seriew of radii and locations cable_segment(section_kind k, std::vector<value_type> r, std::vector<point_type> p): - mc_segment(k), radii_(std::move(r)), locations_(std::move(p)) + segment(k), radii_(std::move(r)), locations_(std::move(p)) { arb_assert(kind_==section_kind::dendrite || kind_==section_kind::axon); update_lengths(); @@ -287,7 +287,7 @@ public: cable_segment(k, {r1, r2}, {p1, p2}) {} - std::unique_ptr<mc_segment> clone() const override { + std::unique_ptr<segment> clone() const override { // use default copy constructor return std::make_unique<cable_segment>(*this); } @@ -404,14 +404,14 @@ private: std::vector<point_type> locations_; }; -using mc_segment_ptr = std::unique_ptr<mc_segment>; +using segment_ptr = std::unique_ptr<segment>; /// Helper for constructing segments in a segment_ptr unique pointer wrapper. /// Forwards the supplied arguments to construct a segment of type SegmentType. /// e.g. auto my_cable = make_segment<cable>(section_kind::dendrite, ... ); template <typename SegmentType, typename... Args> -mc_segment_ptr make_segment(Args&&... args) { - return mc_segment_ptr(new SegmentType(std::forward<Args>(args)...)); +segment_ptr make_segment(Args&&... args) { + return segment_ptr(new SegmentType(std::forward<Args>(args)...)); } } // namespace arb diff --git a/arbor/lif_cell_group.cpp b/arbor/lif_cell_group.cpp index 7622dab2ab8ed04724f7ee3868b7ac00a3f465c8..c87c6692a07006eb7289cb99bc28c124a47f054c 100644 --- a/arbor/lif_cell_group.cpp +++ b/arbor/lif_cell_group.cpp @@ -21,7 +21,7 @@ lif_cell_group::lif_cell_group(const std::vector<cell_gid_type>& gids, const rec } cell_kind lif_cell_group::get_cell_kind() const { - return cell_kind::lif_neuron; + return cell_kind::lif; } void lif_cell_group::advance(epoch ep, time_type dt, const event_lane_subrange& event_lanes) { diff --git a/arbor/mc_cell_group.hpp b/arbor/mc_cell_group.hpp index f22d3b22ea14a59b748a9c8bee61cda3d397dfb8..70f255dc98e9244150aecbf7714e59c6e75e3fe0 100644 --- a/arbor/mc_cell_group.hpp +++ b/arbor/mc_cell_group.hpp @@ -33,7 +33,7 @@ public: mc_cell_group(const std::vector<cell_gid_type>& gids, const recipe& rec, fvm_lowered_cell_ptr lowered); cell_kind get_cell_kind() const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } void reset() override; diff --git a/arbor/partition_load_balance.cpp b/arbor/partition_load_balance.cpp index c393f51cce863d9d3f7afc2dfb28efc8e8d7c7a7..cc09a8618ab2829b4f5c3c29ce99610d9891bb3b 100644 --- a/arbor/partition_load_balance.cpp +++ b/arbor/partition_load_balance.cpp @@ -91,7 +91,7 @@ domain_decomposition partition_load_balance( auto conns = rec.gap_junctions_on(element); for (auto c: conns) { if (element != c.local.gid && element != c.peer.gid) { - throw bad_cell_description(cell_kind::cable1d_neuron, element); + throw bad_cell_description(cell_kind::cable, element); } cell_member_type other = c.local.gid == element ? c.peer : c.local; diff --git a/example/brunel/brunel_miniapp.cpp b/example/brunel/brunel_miniapp.cpp index 320bdcb53c05be51d7a42bc40beafda1b917d7ab..131f273010d72d658493abb012dd926d471250ef 100644 --- a/example/brunel/brunel_miniapp.cpp +++ b/example/brunel/brunel_miniapp.cpp @@ -89,7 +89,7 @@ public: } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::lif_neuron; + return cell_kind::lif; } std::vector<cell_connection> connections_on(cell_gid_type gid) const override { @@ -255,7 +255,7 @@ int main(int argc, char** argv) { brunel_recipe recipe(nexc, ninh, next, in_degree_prop, w, d, rel_inh_strength, poiss_lambda, seed); partition_hint_map hints; - hints[cell_kind::lif_neuron].cpu_group_size = group_size; + hints[cell_kind::lif].cpu_group_size = group_size; auto decomp = partition_load_balance(recipe, context, hints); simulation sim(recipe, decomp, context); diff --git a/example/dryrun/dryrun.cpp b/example/dryrun/dryrun.cpp index 92203545756391163c1dc8295724381235c24a06..12728c69617e455ca331d9bf922ac873d5f97697 100644 --- a/example/dryrun/dryrun.cpp +++ b/example/dryrun/dryrun.cpp @@ -13,7 +13,7 @@ #include <arbor/common_types.hpp> #include <arbor/context.hpp> #include <arbor/load_balance.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/profile/meter_manager.hpp> #include <arbor/profile/profiler.hpp> #include <arbor/simple_sampler.hpp> @@ -41,7 +41,7 @@ using arb::time_type; using arb::cell_probe_address; // Generate a cell. -arb::mc_cell branch_cell(arb::cell_gid_type gid, const cell_parameters& params); +arb::cable_cell branch_cell(arb::cell_gid_type gid, const cell_parameters& params); class tile_desc: public arb::tile { public: @@ -65,7 +65,7 @@ public: } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } // Each cell has one spike detector (at the soma). @@ -143,7 +143,7 @@ struct cell_stats { size_type nsegs_tmp = 0; size_type ncomp_tmp = 0; for (size_type i=b; i<e; ++i) { - auto c = arb::util::any_cast<arb::mc_cell>(r.get_cell_description(i)); + auto c = arb::util::any_cast<arb::cable_cell>(r.get_cell_description(i)); nsegs_tmp += c.num_segments(); ncomp_tmp += c.num_compartments(); } @@ -155,7 +155,7 @@ struct cell_stats { nranks = 1; ncells = r.num_cells(); for (size_type i = 0; i < ncells; ++i) { - auto c = arb::util::any_cast<arb::mc_cell>(r.get_cell_description(i)); + auto c = arb::util::any_cast<arb::cable_cell>(r.get_cell_description(i)); nsegs += c.num_segments(); ncomp += c.num_compartments(); } @@ -166,7 +166,7 @@ struct cell_stats { ncells = r.num_cells(); //total number of cells across all ranks for (size_type i = 0; i < params.num_cells_per_rank; ++i) { - auto c = arb::util::any_cast<arb::mc_cell>(r.get_cell_description(i)); + auto c = arb::util::any_cast<arb::cable_cell>(r.get_cell_description(i)); nsegs += c.num_segments(); ncomp += c.num_compartments(); } @@ -302,8 +302,8 @@ double interp(const std::array<T,2>& r, unsigned i, unsigned n) { return r[0] + p*(r1-r0); } -arb::mc_cell branch_cell(arb::cell_gid_type gid, const cell_parameters& params) { - arb::mc_cell cell; +arb::cable_cell branch_cell(arb::cell_gid_type gid, const cell_parameters& params) { + arb::cable_cell cell; // Add soma. auto soma = cell.add_soma(12.6157/2.0); // For area of 500 μm². diff --git a/example/dryrun/parameters.hpp b/example/dryrun/parameters.hpp index 316ac3ce9746f6902ea7e1e33a71eddaa0cac65c..e355fcf8793e88ad9e2fc1a33300839fd3c9554b 100644 --- a/example/dryrun/parameters.hpp +++ b/example/dryrun/parameters.hpp @@ -5,7 +5,7 @@ #include <fstream> #include <random> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <sup/json_params.hpp> diff --git a/example/dryrun/readme.md b/example/dryrun/readme.md index 1fd9037cb665fa19a7ca5c13d20d3038f78ba827..c0ee998cb90480bc93360aa00c38b0cde2e6f33a 100644 --- a/example/dryrun/readme.md +++ b/example/dryrun/readme.md @@ -4,7 +4,7 @@ A miniapp that demonstrates how to use dry-run mode on a simple network duplicated across `num_ranks`. It uses the `arb::tile` to build a network of `num_cells_per_rank` cells of type -`arb::mc_cell`. The network is translated over `num_ranks` domains using +`arb::cable_cell`. The network is translated over `num_ranks` domains using `arb::symmetric_recipe`. Example: diff --git a/example/gap_junctions/gap_junctions.cpp b/example/gap_junctions/gap_junctions.cpp index e37bb671a4f5fab8df2d1bafc339114505cafc36..2e8381f7542f900b9271cb6891a765af41f63184 100644 --- a/example/gap_junctions/gap_junctions.cpp +++ b/example/gap_junctions/gap_junctions.cpp @@ -13,7 +13,7 @@ #include <arbor/common_types.hpp> #include <arbor/context.hpp> #include <arbor/load_balance.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/profile/meter_manager.hpp> #include <arbor/profile/profiler.hpp> #include <arbor/simple_sampler.hpp> @@ -46,7 +46,7 @@ using arb::cell_probe_address; void write_trace_json(const std::vector<arb::trace_data<double>>& trace, unsigned rank); // Generate a cell. -arb::mc_cell gj_cell(cell_gid_type gid, unsigned ncells, double stim_duration); +arb::cable_cell gj_cell(cell_gid_type gid, unsigned ncells, double stim_duration); class gj_recipe: public arb::recipe { public: @@ -61,7 +61,7 @@ public: } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } // Each cell has one spike detector (at the soma). @@ -96,7 +96,7 @@ public: } arb::util::any get_global_properties(cell_kind k) const override { - arb::mc_cell_global_properties a; + arb::cable_cell_global_properties a; a.temperature_K = 308.15; return a; } @@ -146,7 +146,7 @@ struct cell_stats { size_type nsegs_tmp = 0; size_type ncomp_tmp = 0; for (size_type i=b; i<e; ++i) { - auto c = arb::util::any_cast<arb::mc_cell>(r.get_cell_description(i)); + auto c = arb::util::any_cast<arb::cable_cell>(r.get_cell_description(i)); nsegs_tmp += c.num_segments(); ncomp_tmp += c.num_compartments(); } @@ -155,7 +155,7 @@ struct cell_stats { #else ncells = r.num_cells(); for (size_type i=0; i<ncells; ++i) { - auto c = arb::util::any_cast<arb::mc_cell>(r.get_cell_description(i)); + auto c = arb::util::any_cast<arb::cable_cell>(r.get_cell_description(i)); nsegs += c.num_segments(); ncomp += c.num_compartments(); } @@ -319,8 +319,8 @@ void write_trace_json(const std::vector<arb::trace_data<double>>& trace, unsigne } } -arb::mc_cell gj_cell(cell_gid_type gid, unsigned ncell, double stim_duration) { - arb::mc_cell cell; +arb::cable_cell gj_cell(cell_gid_type gid, unsigned ncell, double stim_duration) { + arb::cable_cell cell; arb::mechanism_desc nax("nax"); arb::mechanism_desc kdrmt("kdrmt"); diff --git a/example/gap_junctions/parameters.hpp b/example/gap_junctions/parameters.hpp index f7dc5f05e539cdc22117ee4c8cc8a493d5b6136f..f68ddfd26df2975b12c595479cd98df19e425afe 100644 --- a/example/gap_junctions/parameters.hpp +++ b/example/gap_junctions/parameters.hpp @@ -5,7 +5,7 @@ #include <fstream> #include <random> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <sup/json_params.hpp> diff --git a/example/generators/event_gen.cpp b/example/generators/event_gen.cpp index 7ea031c489a00e3e922502eab4a71e41a2d40f53..4106e1dc2a10fb19e3aa5848769c9db7a28d7fe0 100644 --- a/example/generators/event_gen.cpp +++ b/example/generators/event_gen.cpp @@ -17,7 +17,7 @@ #include <arbor/domain_decomposition.hpp> #include <arbor/event_generator.hpp> #include <arbor/load_balance.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/simple_sampler.hpp> #include <arbor/recipe.hpp> #include <arbor/simulation.hpp> @@ -47,7 +47,7 @@ public: // capacitance: 0.01 F/m² [default] // synapses: 1 * expsyn arb::util::unique_any get_cell_description(cell_gid_type gid) const override { - arb::mc_cell c; + arb::cable_cell c; c.add_soma(18.8/2.0); // convert 18.8 μm diameter to radius c.soma()->add_mechanism("pas"); @@ -62,7 +62,7 @@ public: cell_kind get_cell_kind(cell_gid_type gid) const override { arb_assert(gid==0); // There is only one cell in the model - return cell_kind::cable1d_neuron; + return cell_kind::cable; } // The cell has one target synapse, which receives both inhibitory and exchitatory inputs. diff --git a/example/generators/readme.md b/example/generators/readme.md index f3f5c87016b2480611c92f2b490c397fc8f60bce..0f2e71f220d83f1d4ffbfbe6996b230b794d9b6d 100644 --- a/example/generators/readme.md +++ b/example/generators/readme.md @@ -46,7 +46,7 @@ which returns an empty list of connections for a cell. Above you can see the definition of `recipe::num_cells()`, which is trivial for this model, which has only once cell. The `recipe::get_cell_description(gid)` and `recipe::get_cell_kind(gid)` methods are defined to return a single -compartment cell with one synapse, and a `arb::cell_kind::cable1d_neuron` respectively: +compartment cell with one synapse, and a `arb::cell_kind::cable` respectively: ```C++ // Return an arb::cell that describes a single compartment cell with @@ -66,7 +66,7 @@ compartment cell with one synapse, and a `arb::cell_kind::cable1d_neuron` respec } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } // There is one synapse, i.e. target, on the cell. diff --git a/example/ring/parameters.hpp b/example/ring/parameters.hpp index 74eb177db794bd5d041e7f9158637d1df3f66ab7..6343cb3c1e9fd73bb7174f5391a6a975952dd68a 100644 --- a/example/ring/parameters.hpp +++ b/example/ring/parameters.hpp @@ -5,7 +5,7 @@ #include <fstream> #include <random> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <sup/json_params.hpp> diff --git a/example/ring/ring.cpp b/example/ring/ring.cpp index 09d6e78b9666a3faeee8e8da4f67827e6c0c9cbd..150baf134983926c956bbcb1b76723c699bcbc13 100644 --- a/example/ring/ring.cpp +++ b/example/ring/ring.cpp @@ -13,7 +13,7 @@ #include <arbor/common_types.hpp> #include <arbor/context.hpp> #include <arbor/load_balance.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/profile/meter_manager.hpp> #include <arbor/profile/profiler.hpp> #include <arbor/simple_sampler.hpp> @@ -46,7 +46,7 @@ using arb::cell_probe_address; void write_trace_json(const arb::trace_data<double>& trace); // Generate a cell. -arb::mc_cell branch_cell(arb::cell_gid_type gid, const cell_parameters& params); +arb::cable_cell branch_cell(arb::cell_gid_type gid, const cell_parameters& params); class ring_recipe: public arb::recipe { public: @@ -65,7 +65,7 @@ public: } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } // Each cell has one spike detector (at the soma). @@ -133,7 +133,7 @@ struct cell_stats { size_type nsegs_tmp = 0; size_type ncomp_tmp = 0; for (size_type i=b; i<e; ++i) { - auto c = arb::util::any_cast<arb::mc_cell>(r.get_cell_description(i)); + auto c = arb::util::any_cast<arb::cable_cell>(r.get_cell_description(i)); nsegs_tmp += c.num_segments(); ncomp_tmp += c.num_compartments(); } @@ -142,7 +142,7 @@ struct cell_stats { #else ncells = r.num_cells(); for (size_type i=0; i<ncells; ++i) { - auto c = arb::util::any_cast<arb::mc_cell>(r.get_cell_description(i)); + auto c = arb::util::any_cast<arb::cable_cell>(r.get_cell_description(i)); nsegs += c.num_segments(); ncomp += c.num_compartments(); } @@ -299,8 +299,8 @@ double interp(const std::array<T,2>& r, unsigned i, unsigned n) { return r[0] + p*(r1-r0); } -arb::mc_cell branch_cell(arb::cell_gid_type gid, const cell_parameters& params) { - arb::mc_cell cell; +arb::cable_cell branch_cell(arb::cell_gid_type gid, const cell_parameters& params) { + arb::cable_cell cell; // Add soma. auto soma = cell.add_soma(12.6157/2.0); // For area of 500 μm². diff --git a/example/single/single.cpp b/example/single/single.cpp index 9237f33503c456c3a91d1d7008d4f487d955e0f2..d1c82bdbba46e5781a642abc1133953360e5119b 100644 --- a/example/single/single.cpp +++ b/example/single/single.cpp @@ -6,7 +6,7 @@ #include <vector> #include <arbor/load_balance.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/morphology.hpp> #include <arbor/swcio.hpp> #include <arbor/simulation.hpp> @@ -43,11 +43,11 @@ struct single_recipe: public arb::recipe { } arb::cell_kind get_cell_kind(arb::cell_gid_type) const override { - return arb::cell_kind::cable1d_neuron; + return arb::cell_kind::cable; } arb::util::unique_any get_cell_description(arb::cell_gid_type) const override { - arb::mc_cell c = make_mc_cell(morpho); + arb::cable_cell c = make_cable_cell(morpho); // Add HH mechanism to soma, passive channels to dendrites. // Discretize dendrites according to the NEURON d-lambda rule. diff --git a/test/common_cells.hpp b/test/common_cells.hpp index 134395caf17a2c391f40b83c20688acea49ecfd0..ae15233e463645caec0ae67c0f74af6919dad4c4 100644 --- a/test/common_cells.hpp +++ b/test/common_cells.hpp @@ -1,7 +1,7 @@ #include <cmath> -#include <arbor/mc_cell.hpp> -#include <arbor/mc_segment.hpp> +#include <arbor/cable_cell.hpp> +#include <arbor/segment.hpp> #include <arbor/mechinfo.hpp> #include <arbor/recipe.hpp> @@ -20,8 +20,8 @@ namespace arb { * soma centre, t=[10 ms, 110 ms), 0.1 nA */ -inline mc_cell make_cell_soma_only(bool with_stim = true) { - mc_cell c; +inline cable_cell make_cell_soma_only(bool with_stim = true) { + cable_cell c; auto soma = c.add_soma(18.8/2.0); soma->add_mechanism("hh"); @@ -54,8 +54,8 @@ inline mc_cell make_cell_soma_only(bool with_stim = true) { * end of dendrite, t=[5 ms, 85 ms), 0.3 nA */ -inline mc_cell make_cell_ball_and_stick(bool with_stim = true) { - mc_cell c; +inline cable_cell make_cell_ball_and_stick(bool with_stim = true) { + cable_cell c; auto soma = c.add_soma(12.6157/2.0); soma->add_mechanism("hh"); @@ -98,8 +98,8 @@ inline mc_cell make_cell_ball_and_stick(bool with_stim = true) { * end of dendrite, t=[5 ms, 85 ms), 0.3 nA */ -inline mc_cell make_cell_ball_and_taper(bool with_stim = true) { - mc_cell c; +inline cable_cell make_cell_ball_and_taper(bool with_stim = true) { + cable_cell c; auto soma = c.add_soma(12.6157/2.0); soma->add_mechanism("hh"); @@ -140,14 +140,14 @@ inline mc_cell make_cell_ball_and_taper(bool with_stim = true) { * end of dendrite, t=[5 ms, 85 ms), 0.3 nA */ -inline mc_cell make_cell_ball_and_squiggle(bool with_stim = true) { - mc_cell c; +inline cable_cell make_cell_ball_and_squiggle(bool with_stim = true) { + cable_cell c; auto soma = c.add_soma(12.6157/2.0); soma->add_mechanism("hh"); - std::vector<mc_cell::value_type> radii; - std::vector<mc_cell::point_type> points; + std::vector<cable_cell::value_type> radii; + std::vector<cable_cell::point_type> points; double length = 100.0; int npoints = 200; @@ -201,8 +201,8 @@ inline mc_cell make_cell_ball_and_squiggle(bool with_stim = true) { * end of second terminal branch, t=[40 ms, 50 ms), -0.2 nA */ -inline mc_cell make_cell_ball_and_3stick(bool with_stim = true) { - mc_cell c; +inline cable_cell make_cell_ball_and_3stick(bool with_stim = true) { + cable_cell c; auto soma = c.add_soma(12.6157/2.0); soma->add_mechanism("hh"); @@ -246,8 +246,8 @@ inline mc_cell make_cell_ball_and_3stick(bool with_stim = true) { * work-around for some existing fvm modelling issues. */ -inline mc_cell make_cell_simple_cable(bool with_stim = true) { - mc_cell c; +inline cable_cell make_cell_simple_cable(bool with_stim = true) { + cable_cell c; c.add_soma(0); c.add_cable(0, section_kind::dendrite, 0.5, 0.5, 1000); diff --git a/test/simple_recipes.hpp b/test/simple_recipes.hpp index bcf528540890a947cb2888057d0628914dad4e5c..6dded63c62e2b721f48bad2547294cb28af764b1 100644 --- a/test/simple_recipes.hpp +++ b/test/simple_recipes.hpp @@ -6,7 +6,7 @@ #include <vector> #include <arbor/event_generator.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/recipe.hpp> namespace arb { @@ -39,7 +39,7 @@ public: util::any get_global_properties(cell_kind k) const override { switch (k) { - case cell_kind::cable1d_neuron: + case cell_kind::cable: return cell_gprop_; default: return util::any{}; @@ -52,7 +52,7 @@ public: protected: std::unordered_map<cell_gid_type, std::vector<probe_info>> probes_; - mc_cell_global_properties cell_gprop_; + cable_cell_global_properties cell_gprop_; mechanism_catalogue catalogue_; }; @@ -84,7 +84,7 @@ protected: Description desc_; }; -// Recipe for a set of `cable1d_neuron` neurons without connections, +// Recipe for a set of `cable` neurons without connections, // and probes which can be added by `add_probe()` (similar to above). // // Cell descriptions passed to the constructor are cloned. @@ -98,13 +98,13 @@ public: } } - explicit cable1d_recipe(const mc_cell& c) { + explicit cable1d_recipe(const cable_cell& c) { cells_.reserve(1); cells_.emplace_back(c); } cell_size_type num_cells() const override { return cells_.size(); } - cell_kind get_cell_kind(cell_gid_type) const override { return cell_kind::cable1d_neuron; } + cell_kind get_cell_kind(cell_gid_type) const override { return cell_kind::cable; } cell_size_type num_sources(cell_gid_type i) const override { return cells_.at(i).detectors().size(); @@ -115,11 +115,11 @@ public: } util::unique_any get_cell_description(cell_gid_type i) const override { - return util::make_unique_any<mc_cell>(cells_[i]); + return util::make_unique_any<cable_cell>(cells_[i]); } protected: - std::vector<mc_cell> cells_; + std::vector<cable_cell> cells_; }; } // namespace arb diff --git a/test/ubench/mech_vec.cpp b/test/ubench/mech_vec.cpp index 2d910a31b0a97184c09f4261a5a309011844b9a2..1691002a72c7a9c4d9c15603100c2d02249e879a 100644 --- a/test/ubench/mech_vec.cpp +++ b/test/ubench/mech_vec.cpp @@ -4,7 +4,7 @@ #include <fstream> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include "backends/multicore/fvm.hpp" #include "benchmark/benchmark.h" @@ -40,7 +40,7 @@ public: } virtual util::unique_any get_cell_description(cell_gid_type gid) const override { - mc_cell c; + cable_cell c; auto soma = c.add_soma(12.6157/2.0); soma->add_mechanism("pas"); @@ -64,7 +64,7 @@ public: } virtual cell_kind get_cell_kind(cell_gid_type) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } }; @@ -79,7 +79,7 @@ public: } virtual util::unique_any get_cell_description(cell_gid_type gid) const override { - mc_cell c; + cable_cell c; auto soma = c.add_soma(12.6157/2.0); soma->add_mechanism("pas"); @@ -96,7 +96,7 @@ public: } virtual cell_kind get_cell_kind(cell_gid_type) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } }; @@ -111,7 +111,7 @@ public: } virtual util::unique_any get_cell_description(cell_gid_type gid) const override { - mc_cell c; + cable_cell c; auto soma = c.add_soma(12.6157/2.0); soma->add_mechanism("pas"); @@ -130,7 +130,7 @@ public: } virtual cell_kind get_cell_kind(cell_gid_type) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } }; @@ -145,7 +145,7 @@ public: } virtual util::unique_any get_cell_description(cell_gid_type gid) const override { - mc_cell c; + cable_cell c; auto soma = c.add_soma(12.6157/2.0); soma->add_mechanism("hh"); @@ -162,7 +162,7 @@ public: } virtual cell_kind get_cell_kind(cell_gid_type) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } }; @@ -177,7 +177,7 @@ public: } virtual util::unique_any get_cell_description(cell_gid_type gid) const override { - mc_cell c; + cable_cell c; auto soma = c.add_soma(12.6157/2.0); soma->add_mechanism("pas"); @@ -196,7 +196,7 @@ public: } virtual cell_kind get_cell_kind(cell_gid_type) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } }; diff --git a/test/unit-distributed/test_communicator.cpp b/test/unit-distributed/test_communicator.cpp index 4eda7ccbba3a0378561f66801e9d9a532788528e..bfa3eef27f524165f5568fdbf80bd10445230021 100644 --- a/test/unit-distributed/test_communicator.cpp +++ b/test/unit-distributed/test_communicator.cpp @@ -198,7 +198,7 @@ namespace { } cell_kind get_cell_kind(cell_gid_type gid) const override { - return gid%2? cell_kind::cable1d_neuron: cell_kind::spike_source; + return gid%2? cell_kind::cable: cell_kind::spike_source; } cell_size_type num_sources(cell_gid_type) const override { return 1; } @@ -261,7 +261,7 @@ namespace { return {}; } cell_kind get_cell_kind(cell_gid_type gid) const override { - return gid%2? cell_kind::cable1d_neuron: cell_kind::spike_source; + return gid%2? cell_kind::cable: cell_kind::spike_source; } cell_size_type num_sources(cell_gid_type) const override { return 1; } diff --git a/test/unit-distributed/test_domain_decomposition.cpp b/test/unit-distributed/test_domain_decomposition.cpp index 27e69004ddd0520720e008eb6b2e85c51fb3a471..e4a903d630d87f8580cd3128bdfbc099373dee1e 100644 --- a/test/unit-distributed/test_domain_decomposition.cpp +++ b/test/unit-distributed/test_domain_decomposition.cpp @@ -27,7 +27,7 @@ namespace { // Dummy recipes types for testing. struct dummy_cell {}; - using homo_recipe = homogeneous_recipe<cell_kind::cable1d_neuron, dummy_cell>; + using homo_recipe = homogeneous_recipe<cell_kind::cable, dummy_cell>; // Heterogenous cell population of cable and rss cells. // Interleaved so that cells with even gid are cable cells, and even gid are @@ -48,7 +48,7 @@ namespace { cell_kind get_cell_kind(cell_gid_type gid) const override { return gid%2? cell_kind::spike_source: - cell_kind::cable1d_neuron; + cell_kind::cable; } cell_size_type num_sources(cell_gid_type) const override { return 0; } @@ -81,7 +81,7 @@ namespace { } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } std::vector<gap_junction_connection> gap_junctions_on(cell_gid_type gid) const override { unsigned shift = (gid/size_)*size_; @@ -122,7 +122,7 @@ namespace { } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } std::vector<gap_junction_connection> gap_junctions_on(cell_gid_type gid) const override { unsigned group = gid/groups_; @@ -175,7 +175,7 @@ TEST(domain_decomposition, homogeneous_population_mc) { EXPECT_EQ(I, (unsigned)D.gid_domain(gid)); } - // Each cell group contains 1 cell of kind cable1d_neuron + // Each cell group contains 1 cell of kind cable // Each group should also be tagged for cpu execution for (auto i: gids) { auto local_group = i-b; @@ -183,7 +183,7 @@ TEST(domain_decomposition, homogeneous_population_mc) { EXPECT_EQ(grp.gids.size(), 1u); EXPECT_EQ(grp.gids.front(), unsigned(i)); EXPECT_EQ(grp.backend, backend_kind::multicore); - EXPECT_EQ(grp.kind, cell_kind::cable1d_neuron); + EXPECT_EQ(grp.kind, cell_kind::cable); } } @@ -226,7 +226,7 @@ TEST(domain_decomposition, homogeneous_population_gpu) { EXPECT_EQ(I, (unsigned)D.gid_domain(gid)); } - // Each cell group contains 1 cell of kind cable1d_neuron + // Each cell group contains 1 cell of kind cable // Each group should also be tagged for cpu execution auto grp = D.groups[0u]; @@ -234,7 +234,7 @@ TEST(domain_decomposition, homogeneous_population_gpu) { EXPECT_EQ(grp.gids.front(), b); EXPECT_EQ(grp.gids.back(), e-1); EXPECT_EQ(grp.backend, backend_kind::gpu); - EXPECT_EQ(grp.kind, cell_kind::cable1d_neuron); + EXPECT_EQ(grp.kind, cell_kind::cable); } #endif @@ -272,7 +272,7 @@ TEST(domain_decomposition, heterogeneous_population) { EXPECT_EQ(I, (unsigned)D.gid_domain(gid)); } - // Each cell group contains 1 cell of kind cable1d_neuron + // Each cell group contains 1 cell of kind cable // Each group should also be tagged for cpu execution auto grps = util::make_span(0, n_local_grps); std::map<cell_kind, std::set<cell_gid_type>> kind_lists; @@ -283,7 +283,7 @@ TEST(domain_decomposition, heterogeneous_population) { EXPECT_EQ(grp.backend, backend_kind::multicore); } - for (auto k: {cell_kind::cable1d_neuron, cell_kind::spike_source}) { + for (auto k: {cell_kind::cable, cell_kind::spike_source}) { const auto& gids = kind_lists[k]; EXPECT_EQ(gids.size(), n_local/2); for (auto gid: gids) { @@ -329,8 +329,8 @@ TEST(domain_decomposition, symmetric_groups) // Test different group_hints partition_hint_map hints; - hints[cell_kind::cable1d_neuron].cpu_group_size = R.num_cells(); - hints[cell_kind::cable1d_neuron].prefer_gpu = false; + hints[cell_kind::cable].cpu_group_size = R.num_cells(); + hints[cell_kind::cable].prefer_gpu = false; const auto D1 = partition_load_balance(R, ctx, hints); EXPECT_EQ(1u, D1.groups.size()); @@ -345,8 +345,8 @@ TEST(domain_decomposition, symmetric_groups) EXPECT_EQ(i/cells_per_rank, (unsigned)D1.gid_domain(i)); } - hints[cell_kind::cable1d_neuron].cpu_group_size = cells_per_rank/2; - hints[cell_kind::cable1d_neuron].prefer_gpu = false; + hints[cell_kind::cable].cpu_group_size = cells_per_rank/2; + hints[cell_kind::cable].prefer_gpu = false; const auto D2 = partition_load_balance(R, ctx, hints); EXPECT_EQ(2u, D2.groups.size()); diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 977372b9f2d3f734d4ac7ff0157e4db82dd1c80d..696683f1f61400f18d9f0bcbaaca5b54003d7f56 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -77,7 +77,7 @@ set(unit_sources test_mask_stream.cpp test_math.cpp test_matrix.cpp - test_mc_cell.cpp + test_cable_cell.cpp test_mechanisms.cpp test_mech_temperature.cpp test_mechcat.cpp diff --git a/test/unit/test_mc_cell.cpp b/test/unit/test_cable_cell.cpp similarity index 93% rename from test/unit/test_mc_cell.cpp rename to test/unit/test_cable_cell.cpp index 683f133e43fb599d2cb6fc092ccee4994343f3ee..f297a50d5c4035ce8d9981604e5297827cf1ffb0 100644 --- a/test/unit/test_mc_cell.cpp +++ b/test/unit/test_cable_cell.cpp @@ -1,6 +1,6 @@ #include "../gtest.h" -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/math.hpp> #include "tree.hpp" @@ -8,11 +8,11 @@ using namespace arb; using ::arb::math::pi; -TEST(mc_cell, soma) { +TEST(cable_cell, soma) { // test that insertion of a soma works // define with no centre point { - mc_cell c; + cable_cell c; auto soma_radius = 2.1; EXPECT_EQ(c.has_soma(), false); @@ -27,7 +27,7 @@ TEST(mc_cell, soma) { // test that insertion of a soma works // define with centre point @ (0,0,1) { - mc_cell c; + cable_cell c; auto soma_radius = 3.2; EXPECT_EQ(c.has_soma(), false); @@ -43,10 +43,10 @@ TEST(mc_cell, soma) { } } -TEST(mc_cell, add_segment) { +TEST(cable_cell, add_segment) { // add a pre-defined segment { - mc_cell c; + cable_cell c; auto soma_radius = 2.1; auto cable_radius = 0.1; @@ -67,7 +67,7 @@ TEST(mc_cell, add_segment) { // add segment on the fly { - mc_cell c; + cable_cell c; auto soma_radius = 2.1; auto cable_radius = 0.1; @@ -84,7 +84,7 @@ TEST(mc_cell, add_segment) { EXPECT_EQ(c.num_segments(), 2u); } { - mc_cell c; + cable_cell c; auto soma_radius = 2.1; auto cable_radius = 0.1; @@ -104,7 +104,7 @@ TEST(mc_cell, add_segment) { } } -TEST(mc_cell, multiple_cables) { +TEST(cable_cell, multiple_cables) { // generate a cylindrical cable segment of length 1/pi and radius 1 // volume = 1 // area = 2 @@ -114,7 +114,7 @@ TEST(mc_cell, multiple_cables) { // add a pre-defined segment { - mc_cell c; + cable_cell c; auto soma_radius = std::pow(3./(4.*pi<double>), 1./3.); @@ -158,8 +158,8 @@ TEST(mc_cell, multiple_cables) { } } -TEST(mc_cell, unbranched_chain) { - mc_cell c; +TEST(cable_cell, unbranched_chain) { + cable_cell c; auto soma_radius = std::pow(3./(4.*pi<double>), 1./3.); @@ -191,10 +191,10 @@ TEST(mc_cell, unbranched_chain) { EXPECT_EQ(con.num_children(2), 0u); } -TEST(mc_cell, clone) { +TEST(cable_cell, clone) { // make simple cell with multiple segments - mc_cell c; + cable_cell c; c.add_soma(2.1); c.add_cable(0, section_kind::dendrite, 0.3, 0.2, 10); c.segment(1)->set_compartments(3); @@ -207,7 +207,7 @@ TEST(mc_cell, clone) { // make clone - mc_cell d(c); + cable_cell d(c); // check equality @@ -243,7 +243,7 @@ TEST(mc_cell, clone) { EXPECT_EQ(c.segment(2)->num_compartments(), d.segment(2)->num_compartments()); } -TEST(mc_cell, get_kind) { - mc_cell c; - EXPECT_EQ(cell_kind::cable1d_neuron, c.get_cell_kind()); +TEST(cable_cell, get_kind) { + cable_cell c; + EXPECT_EQ(cell_kind::cable, c.get_cell_kind()); } diff --git a/test/unit/test_domain_decomposition.cpp b/test/unit/test_domain_decomposition.cpp index d19313b1a9cf7f84a924500593824e7f9868c26a..9acd94e09dbe8888f6b17a40295b2d291f33f9fd 100644 --- a/test/unit/test_domain_decomposition.cpp +++ b/test/unit/test_domain_decomposition.cpp @@ -28,7 +28,7 @@ namespace { // Dummy recipes types for testing. struct dummy_cell {}; - using homo_recipe = homogeneous_recipe<cell_kind::cable1d_neuron, dummy_cell>; + using homo_recipe = homogeneous_recipe<cell_kind::cable, dummy_cell>; // Heterogenous cell population of cable and spike source cells. // Interleaved so that cells with even gid are cable cells, and odd gid are @@ -48,7 +48,7 @@ namespace { cell_kind get_cell_kind(cell_gid_type gid) const override { return gid%2? cell_kind::spike_source: - cell_kind::cable1d_neuron; + cell_kind::cable; } private: @@ -64,14 +64,14 @@ namespace { } arb::util::unique_any get_cell_description(cell_gid_type) const override { - mc_cell c; + cable_cell c; c.add_soma(20); c.add_gap_junction({0,1}); return {std::move(c)}; } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } std::vector<gap_junction_connection> gap_junctions_on(cell_gid_type gid) const override { switch (gid) { @@ -135,7 +135,7 @@ TEST(domain_decomposition, homogenous_population) EXPECT_EQ(0, D.gid_domain(gid)); } - // Each cell group contains 1 cell of kind cable1d_neuron + // Each cell group contains 1 cell of kind cable // Each group should also be tagged for cpu execution auto grp = D.groups[0u]; @@ -143,7 +143,7 @@ TEST(domain_decomposition, homogenous_population) EXPECT_EQ(grp.gids.front(), 0u); EXPECT_EQ(grp.gids.back(), num_cells-1); EXPECT_EQ(grp.backend, backend_kind::gpu); - EXPECT_EQ(grp.kind, cell_kind::cable1d_neuron); + EXPECT_EQ(grp.kind, cell_kind::cable); } { resources.gpu_id = -1; // disable GPU if available @@ -166,14 +166,14 @@ TEST(domain_decomposition, homogenous_population) EXPECT_EQ(0, D.gid_domain(gid)); } - // Each cell group contains 1 cell of kind cable1d_neuron + // Each cell group contains 1 cell of kind cable // Each group should also be tagged for cpu execution for (auto i: gids) { auto& grp = D.groups[i]; EXPECT_EQ(grp.gids.size(), 1u); EXPECT_EQ(grp.gids.front(), unsigned(i)); EXPECT_EQ(grp.backend, backend_kind::multicore); - EXPECT_EQ(grp.kind, cell_kind::cable1d_neuron); + EXPECT_EQ(grp.kind, cell_kind::cable); } } } @@ -205,7 +205,7 @@ TEST(domain_decomposition, heterogenous_population) for (auto i: grps) { auto& grp = D.groups[i]; auto k = grp.kind; - if (k==cell_kind::cable1d_neuron) { + if (k==cell_kind::cable) { EXPECT_EQ(grp.backend, backend_kind::gpu); EXPECT_EQ(grp.gids.size(), num_cells/2); for (auto gid: grp.gids) { @@ -244,7 +244,7 @@ TEST(domain_decomposition, heterogenous_population) EXPECT_EQ(0, D.gid_domain(gid)); } - // Each cell group contains 1 cell of kind cable1d_neuron + // Each cell group contains 1 cell of kind cable // Each group should also be tagged for cpu execution auto grps = make_span(num_cells); std::map<cell_kind, std::set<cell_gid_type>> kind_lists; @@ -256,7 +256,7 @@ TEST(domain_decomposition, heterogenous_population) EXPECT_EQ(grp.backend, backend_kind::multicore); } - for (auto k: {cell_kind::cable1d_neuron, cell_kind::spike_source}) { + for (auto k: {cell_kind::cable, cell_kind::spike_source}) { const auto& gids = kind_lists[k]; EXPECT_EQ(gids.size(), num_cells/2); for (auto gid: gids) { @@ -276,8 +276,8 @@ TEST(domain_decomposition, hints) { auto ctx = make_context(); partition_hint_map hints; - hints[cell_kind::cable1d_neuron].cpu_group_size = 3; - hints[cell_kind::cable1d_neuron].prefer_gpu = false; + hints[cell_kind::cable].cpu_group_size = 3; + hints[cell_kind::cable].prefer_gpu = false; hints[cell_kind::spike_source].cpu_group_size = 4; domain_decomposition D = partition_load_balance( @@ -294,9 +294,9 @@ TEST(domain_decomposition, hints) { std::vector<std::vector<cell_gid_type>> c1d_groups, ss_groups; for (auto& g: D.groups) { - EXPECT_TRUE(g.kind==cell_kind::cable1d_neuron || g.kind==cell_kind::spike_source); + EXPECT_TRUE(g.kind==cell_kind::cable || g.kind==cell_kind::spike_source); - if (g.kind==cell_kind::cable1d_neuron) { + if (g.kind==cell_kind::cable) { c1d_groups.push_back(g.gids); } else if (g.kind==cell_kind::spike_source) { @@ -328,8 +328,8 @@ TEST(domain_decomposition, compulsory_groups) // Test different group_hints partition_hint_map hints; - hints[cell_kind::cable1d_neuron].cpu_group_size = 3; - hints[cell_kind::cable1d_neuron].prefer_gpu = false; + hints[cell_kind::cable].cpu_group_size = 3; + hints[cell_kind::cable].prefer_gpu = false; const auto D1 = partition_load_balance(R, ctx, hints); EXPECT_EQ(5u, D1.groups.size()); @@ -341,8 +341,8 @@ TEST(domain_decomposition, compulsory_groups) EXPECT_EQ(expected_groups1[i], D1.groups[i].gids); } - hints[cell_kind::cable1d_neuron].cpu_group_size = 20; - hints[cell_kind::cable1d_neuron].prefer_gpu = false; + hints[cell_kind::cable].cpu_group_size = 20; + hints[cell_kind::cable].prefer_gpu = false; const auto D2 = partition_load_balance(R, ctx, hints); EXPECT_EQ(1u, D2.groups.size()); diff --git a/test/unit/test_event_delivery.cpp b/test/unit/test_event_delivery.cpp index 905d8cb428a6ea48b8b5c5bf66ceb6c43f4f01f1..cafba40f1982fde675cccc26d0cce059b6a7e320 100644 --- a/test/unit/test_event_delivery.cpp +++ b/test/unit/test_event_delivery.cpp @@ -9,7 +9,7 @@ #include <arbor/common_types.hpp> #include <arbor/domain_decomposition.hpp> #include <arbor/simulation.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/spike.hpp> #include <arbor/spike_event.hpp> @@ -21,13 +21,13 @@ using namespace arb; -using n_mc_cell_recipe = homogeneous_recipe<cell_kind::cable1d_neuron, mc_cell>; +using n_cable_cell_recipe = homogeneous_recipe<cell_kind::cable, cable_cell>; -struct test_recipe: public n_mc_cell_recipe { - explicit test_recipe(int n): n_mc_cell_recipe(n, test_cell()) {} +struct test_recipe: public n_cable_cell_recipe { + explicit test_recipe(int n): n_cable_cell_recipe(n, test_cell()) {} - static mc_cell test_cell() { - mc_cell c; + static cable_cell test_cell() { + cable_cell c; c.add_soma(10.)->add_mechanism("pas"); c.add_synapse({0, 0.5}, "expsyn"); c.add_detector({0, 0.5}, -64); @@ -53,7 +53,7 @@ std::vector<cell_gid_type> run_test_sim(const recipe& R, const group_gids_type& D.num_global_cells = n; for (const auto& gidvec: group_gids) { - group_description group{cell_kind::cable1d_neuron, gidvec, backend_kind::multicore}; + group_description group{cell_kind::cable, gidvec, backend_kind::multicore}; D.groups.push_back(group); } diff --git a/test/unit/test_fvm_layout.cpp b/test/unit/test_fvm_layout.cpp index a3d6039e13325652953985c0292932abbbe04948..0b9496a0ced1a3a4b7aa86cffb0cb20a58877830 100644 --- a/test/unit/test_fvm_layout.cpp +++ b/test/unit/test_fvm_layout.cpp @@ -4,7 +4,7 @@ #include <arbor/util/optional.hpp> #include <arbor/mechcat.hpp> #include <arbor/math.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include "fvm_layout.hpp" #include "util/maputil.hpp" @@ -22,7 +22,7 @@ using util::count_along; using util::value_by_key; namespace { - double area(const mc_segment* s) { + double area(const segment* s) { if (auto soma = s->as_soma()) { return math::area_sphere(soma->radius()); } @@ -39,7 +39,7 @@ namespace { } } - double volume(const mc_segment* s) { + double volume(const segment* s) { if (auto soma = s->as_soma()) { return math::volume_sphere(soma->radius()); } @@ -56,8 +56,8 @@ namespace { } } - std::vector<mc_cell> two_cell_system() { - std::vector<mc_cell> cells; + std::vector<cable_cell> two_cell_system() { + std::vector<cable_cell> cells; // Cell 0: simple ball and stick (see common_cells.hpp) cells.push_back(make_cell_ball_and_stick()); @@ -90,8 +90,8 @@ namespace { // // All dendrite segments with 4 compartments. - mc_cell c2; - mc_segment* s; + cable_cell c2; + segment* s; s = c2.add_soma(14./2); s->add_mechanism("hh"); @@ -119,7 +119,7 @@ namespace { return cells; } - void check_two_cell_system(std::vector<mc_cell>& cells) { + void check_two_cell_system(std::vector<cable_cell>& cells) { ASSERT_EQ(2u, cells[0].num_segments()); ASSERT_EQ(cells[0].segment(1)->num_compartments(), 4u); ASSERT_EQ(cells[1].num_segments(), 4u); @@ -130,7 +130,7 @@ namespace { } // namespace TEST(fvm_layout, topology) { - std::vector<mc_cell> cells = two_cell_system(); + std::vector<cable_cell> cells = two_cell_system(); check_two_cell_system(cells); fvm_discretization D = fvm_discretize(cells); @@ -210,7 +210,7 @@ TEST(fvm_layout, topology) { } TEST(fvm_layout, area) { - std::vector<mc_cell> cells = two_cell_system(); + std::vector<cable_cell> cells = two_cell_system(); check_two_cell_system(cells); fvm_discretization D = fvm_discretize(cells); @@ -283,7 +283,7 @@ TEST(fvm_layout, area) { } TEST(fvm_layout, mech_index) { - std::vector<mc_cell> cells = two_cell_system(); + std::vector<cable_cell> cells = two_cell_system(); check_two_cell_system(cells); // Add four synapses of two varieties across the cells. @@ -351,7 +351,7 @@ TEST(fvm_layout, coalescing_synapses) { }; { - mc_cell cell = make_cell_ball_and_stick(); + cable_cell cell = make_cell_ball_and_stick(); // Add synapses of two varieties. cell.add_synapse({1, 0.3}, "expsyn"); @@ -367,7 +367,7 @@ TEST(fvm_layout, coalescing_synapses) { EXPECT_EQ(ivec({1, 1, 1, 1}), expsyn_config.multiplicity); } { - mc_cell cell = make_cell_ball_and_stick(); + cable_cell cell = make_cell_ball_and_stick(); // Add synapses of two varieties. cell.add_synapse({1, 0.3}, "expsyn"); @@ -387,7 +387,7 @@ TEST(fvm_layout, coalescing_synapses) { EXPECT_EQ(ivec({1, 1}), exp2syn_config.multiplicity); } { - mc_cell cell = make_cell_ball_and_stick(); + cable_cell cell = make_cell_ball_and_stick(); // Add synapses of two varieties. cell.add_synapse({1, 0.3}, "expsyn"); @@ -403,7 +403,7 @@ TEST(fvm_layout, coalescing_synapses) { EXPECT_EQ(ivec({2, 2}), expsyn_config.multiplicity); } { - mc_cell cell = make_cell_ball_and_stick(); + cable_cell cell = make_cell_ball_and_stick(); // Add synapses of two varieties. cell.add_synapse({1, 0.3}, syn_desc("expsyn", 0, 0.2)); @@ -421,7 +421,7 @@ TEST(fvm_layout, coalescing_synapses) { EXPECT_EQ(fvec({0.2, 0.2, 0.2}), expsyn_config.param_values[1].second); } { - mc_cell cell = make_cell_ball_and_stick(); + cable_cell cell = make_cell_ball_and_stick(); // Add synapses of two varieties. cell.add_synapse({1, 0.7}, syn_desc("expsyn", 0, 3)); @@ -444,7 +444,7 @@ TEST(fvm_layout, coalescing_synapses) { EXPECT_EQ(fvec({2, 2, 3, 3}), expsyn_config.param_values[1].second); } { - mc_cell cell = make_cell_ball_and_stick(); + cable_cell cell = make_cell_ball_and_stick(); // Add synapses of two varieties. cell.add_synapse({1, 0.3}, syn_desc("expsyn", 1, 2)); @@ -478,7 +478,7 @@ TEST(fvm_layout, coalescing_synapses) { } TEST(fvm_layout, synapse_targets) { - std::vector<mc_cell> cells = two_cell_system(); + std::vector<cable_cell> cells = two_cell_system(); // Add synapses with different parameter values so that we can // ensure: 1) CVs for each synapse mechanism are sorted while @@ -587,8 +587,8 @@ TEST(fvm_layout, density_norm_area) { // // Use divided compartment view on segments to compute area contributions. - std::vector<mc_cell> cells(1); - mc_cell& c = cells[0]; + std::vector<cable_cell> cells(1); + cable_cell& c = cells[0]; auto soma = c.add_soma(12.6157/2.0); c.add_cable(0, section_kind::dendrite, 0.5, 0.5, 100); @@ -606,7 +606,7 @@ TEST(fvm_layout, density_norm_area) { double seg3_gl = .0004; for (int i = 0; i<4; ++i) { - mc_segment& seg = *segs[i]; + segment& seg = *segs[i]; seg.set_compartments(3); mechanism_desc hh("hh"); @@ -717,7 +717,7 @@ TEST(fvm_layout, ion_weights) { // the same as a 100µm dendrite, which makes it easier to describe the // expected weights. - auto construct_cell = [](mc_cell& c) { + auto construct_cell = [](cable_cell& c) { c.add_soma(5); c.add_cable(0, section_kind::dendrite, 0.5, 0.5, 100); @@ -744,8 +744,8 @@ TEST(fvm_layout, ion_weights) { }; for (auto run: count_along(mech_segs)) { - std::vector<mc_cell> cells(1); - mc_cell& c = cells[0]; + std::vector<cable_cell> cells(1); + cable_cell& c = cells[0]; construct_cell(c); for (auto i: mech_segs[run]) { diff --git a/test/unit/test_fvm_lowered.cpp b/test/unit/test_fvm_lowered.cpp index 8e2c2f25bd01e43c274061a9d52f82c5cc75a240..cdc09371322f6e018aa5f9127c364ea1a3b10ce8 100644 --- a/test/unit/test_fvm_lowered.cpp +++ b/test/unit/test_fvm_lowered.cpp @@ -8,8 +8,8 @@ #include <arbor/fvm_types.hpp> #include <arbor/load_balance.hpp> #include <arbor/math.hpp> -#include <arbor/mc_cell.hpp> -#include <arbor/mc_segment.hpp> +#include <arbor/cable_cell.hpp> +#include <arbor/segment.hpp> #include <arbor/recipe.hpp> #include <arbor/sampling.hpp> #include <arbor/simulation.hpp> @@ -87,14 +87,14 @@ public: } arb::util::unique_any get_cell_description(cell_gid_type gid) const override { - mc_cell c; + cable_cell c; c.add_soma(20); c.add_gap_junction({0, 1}); return {std::move(c)}; } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } std::vector<gap_junction_connection> gap_junctions_on(cell_gid_type gid) const override { switch (gid) { @@ -133,13 +133,13 @@ public: } arb::util::unique_any get_cell_description(cell_gid_type) const override { - mc_cell c; + cable_cell c; c.add_soma(20); return {std::move(c)}; } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } private: @@ -155,14 +155,14 @@ public: } arb::util::unique_any get_cell_description(cell_gid_type) const override { - mc_cell c; + cable_cell c; c.add_soma(20); c.add_gap_junction({0,1}); return {std::move(c)}; } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::cable1d_neuron; + return cell_kind::cable; } std::vector<gap_junction_connection> gap_junctions_on(cell_gid_type gid) const override { switch (gid) { @@ -208,7 +208,7 @@ TEST(fvm_lowered, matrix_init) auto ispos = [](auto v) { return v>0; }; auto isneg = [](auto v) { return v<0; }; - mc_cell cell = make_cell_ball_and_stick(); + cable_cell cell = make_cell_ball_and_stick(); ASSERT_EQ(2u, cell.num_segments()); cell.segment(1)->set_compartments(10); @@ -243,7 +243,7 @@ TEST(fvm_lowered, target_handles) { execution_context context; - mc_cell cells[] = { + cable_cell cells[] = { make_cell_ball_and_stick(), make_cell_ball_and_3stick() }; @@ -305,7 +305,7 @@ TEST(fvm_lowered, stimulus) { execution_context context; - std::vector<mc_cell> cells; + std::vector<cable_cell> cells; cells.push_back(make_cell_ball_and_stick(false)); cells[0].add_stimulus({1,1}, {5., 80., 0.3}); @@ -381,9 +381,9 @@ TEST(fvm_lowered, derived_mechs) { // // 3. Cell with both test_kin1 and custom_kin1. - std::vector<mc_cell> cells(3); + std::vector<cable_cell> cells(3); for (int i = 0; i<3; ++i) { - mc_cell& c = cells[i]; + cable_cell& c = cells[i]; c.add_soma(6.0); c.add_cable(0, section_kind::dendrite, 0.5, 0.5, 100); @@ -508,7 +508,7 @@ TEST(fvm_lowered, weighted_write_ion) { execution_context context; - mc_cell c; + cable_cell c; c.add_soma(5); c.add_cable(0, section_kind::dendrite, 0.5, 0.5, 100); @@ -581,7 +581,7 @@ TEST(fvm_lowered, gj_coords_simple) { gap_recipe() {} cell_size_type num_cells() const override { return n_; } - cell_kind get_cell_kind(cell_gid_type) const override { return cell_kind::cable1d_neuron; } + cell_kind get_cell_kind(cell_gid_type) const override { return cell_kind::cable; } util::unique_any get_cell_description(cell_gid_type gid) const override { return {}; } @@ -599,8 +599,8 @@ TEST(fvm_lowered, gj_coords_simple) { fvm_cell fvcell(context); gap_recipe rec; - std::vector<mc_cell> cells; - mc_cell c, d; + std::vector<cable_cell> cells; + cable_cell c, d; c.add_soma(2.1); c.add_cable(0, section_kind::dendrite, 0.3, 0.2, 10); c.segment(1)->set_compartments(5); @@ -637,7 +637,7 @@ TEST(fvm_lowered, gj_coords_complex) { gap_recipe() {} cell_size_type num_cells() const override { return n_; } - cell_kind get_cell_kind(cell_gid_type) const override { return cell_kind::cable1d_neuron; } + cell_kind get_cell_kind(cell_gid_type) const override { return cell_kind::cable; } util::unique_any get_cell_description(cell_gid_type gid) const override { return {}; } @@ -673,8 +673,8 @@ TEST(fvm_lowered, gj_coords_complex) { fvm_cell fvcell(context); gap_recipe rec; - mc_cell c0, c1, c2; - std::vector<mc_cell> cells; + cable_cell c0, c1, c2; + std::vector<cable_cell> cells; // Make 3 cells c0.add_soma(2.1); @@ -760,7 +760,7 @@ TEST(fvm_lowered, cell_group_gj) { gap_recipe() {} cell_size_type num_cells() const override { return n_; } - cell_kind get_cell_kind(cell_gid_type) const override { return cell_kind::cable1d_neuron; } + cell_kind get_cell_kind(cell_gid_type) const override { return cell_kind::cable; } util::unique_any get_cell_description(cell_gid_type gid) const override { return {}; } @@ -783,12 +783,12 @@ TEST(fvm_lowered, cell_group_gj) { fvm_cell fvcell(context); gap_recipe rec; - std::vector<mc_cell> cell_group0; - std::vector<mc_cell> cell_group1; + std::vector<cable_cell> cell_group0; + std::vector<cable_cell> cell_group1; // Make 20 cells for (unsigned i = 0; i < 20; i++) { - mc_cell c; + cable_cell c; c.add_soma(2.1); if (i % 2 == 0) { c.add_gap_junction({0, 1}); diff --git a/test/unit/test_lif_cell_group.cpp b/test/unit/test_lif_cell_group.cpp index 7f0e8d839fbb3f93d47ad3155c1949e8635e4684..2247ef483158a4bff3954d5c30809f9723ddecdf 100644 --- a/test/unit/test_lif_cell_group.cpp +++ b/test/unit/test_lif_cell_group.cpp @@ -28,7 +28,7 @@ public: if (gid == 0) { return cell_kind::spike_source; } - return cell_kind::lif_neuron; + return cell_kind::lif; } std::vector<cell_connection> connections_on(cell_gid_type gid) const override { @@ -99,7 +99,7 @@ public: } cell_kind get_cell_kind(cell_gid_type gid) const override { - return cell_kind::lif_neuron; + return cell_kind::lif; } std::vector<cell_connection> connections_on(cell_gid_type gid) const override { diff --git a/test/unit/test_mc_cell_group.cpp b/test/unit/test_mc_cell_group.cpp index 11e333007d9d4153174a63c90a45ae273ec3db51..ed9cc54345e8ed05a7878877152ebd0268894c36 100644 --- a/test/unit/test_mc_cell_group.cpp +++ b/test/unit/test_mc_cell_group.cpp @@ -20,7 +20,7 @@ namespace { return make_fvm_lowered_cell(backend_kind::multicore, context); } - mc_cell make_cell() { + cable_cell make_cell() { auto c = make_cell_ball_and_stick(); c.add_detector({0, 0}, 0); @@ -38,7 +38,7 @@ ACCESS_BIND( TEST(mc_cell_group, get_kind) { mc_cell_group group{{0}, cable1d_recipe(make_cell()), lowered_cell()}; - EXPECT_EQ(cell_kind::cable1d_neuron, group.get_cell_kind()); + EXPECT_EQ(cell_kind::cable, group.get_cell_kind()); } TEST(mc_cell_group, test) { @@ -53,7 +53,7 @@ TEST(mc_cell_group, test) { TEST(mc_cell_group, sources) { // Make twenty cells, with an extra detector on gids 0, 3 and 17 // to make things more interesting. - std::vector<mc_cell> cells; + std::vector<cable_cell> cells; for (int i=0; i<20; ++i) { cells.push_back(make_cell()); diff --git a/test/unit/test_mc_cell_group_gpu.cpp b/test/unit/test_mc_cell_group_gpu.cpp index 7628dce147c61966aa77bab1cdbb24cbc62f6d65..b859b9a5532274da03ddd952a1012e999ff6b2e9 100644 --- a/test/unit/test_mc_cell_group_gpu.cpp +++ b/test/unit/test_mc_cell_group_gpu.cpp @@ -18,7 +18,7 @@ namespace { return make_fvm_lowered_cell(backend_kind::gpu, context); } - mc_cell make_cell() { + cable_cell make_cell() { auto c = make_cell_ball_and_stick(); c.add_detector({0, 0}, 0); diff --git a/test/unit/test_mechinfo.cpp b/test/unit/test_mechinfo.cpp index e5f63588dfb9260b925be7c1646a09645ccaa2e4..d7d20c8dbf1db84369201bfb3c78c538b76fe744 100644 --- a/test/unit/test_mechinfo.cpp +++ b/test/unit/test_mechinfo.cpp @@ -2,7 +2,7 @@ #include <string> #include <vector> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include "../gtest.h" diff --git a/test/unit/test_probe.cpp b/test/unit/test_probe.cpp index 6f449cb165346ef53925407ede2508047746e531..989a6cc822cfd3617959e3adc7821c838c168f7b 100644 --- a/test/unit/test_probe.cpp +++ b/test/unit/test_probe.cpp @@ -1,7 +1,7 @@ #include "../gtest.h" #include <arbor/common_types.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include "backends/event.hpp" #include "backends/multicore/fvm.hpp" @@ -21,7 +21,7 @@ ACCESS_BIND(std::unique_ptr<shared_state> fvm_cell::*, fvm_state_ptr, &fvm_cell: TEST(probe, fvm_lowered_cell) { execution_context context; - mc_cell bs = make_cell_ball_and_stick(false); + cable_cell bs = make_cell_ball_and_stick(false); i_clamp stim(0, 100, 0.3); bs.add_stimulus({1, 1}, stim); diff --git a/test/unit/test_segment.cpp b/test/unit/test_segment.cpp index 128f629bb83e8ce3395e5d98c53947539f621fa1..509f889c3ac381a0f7ef5ced0fa984ca294b86c9 100644 --- a/test/unit/test_segment.cpp +++ b/test/unit/test_segment.cpp @@ -3,11 +3,11 @@ #include "../gtest.h" #include <arbor/math.hpp> -#include <arbor/mc_segment.hpp> +#include <arbor/segment.hpp> using namespace arb; -TEST(mc_segment, kinfs) { +TEST(segment, kinfs) { using ::arb::math::pi; { diff --git a/test/unit/test_swcio.cpp b/test/unit/test_swcio.cpp index 172439e6707f82322240f73ec77c11b660bace7b..3a22d257cc3fdc29f310fc7d31f98e140d9ea7eb 100644 --- a/test/unit/test_swcio.cpp +++ b/test/unit/test_swcio.cpp @@ -7,7 +7,7 @@ #include <type_traits> #include <vector> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/morphology.hpp> #include <arbor/swcio.hpp> @@ -457,7 +457,7 @@ TEST(swc_io, cell_construction) { // swc -> morphology auto morph = swc_as_morphology(parse_swc_file(is)); - mc_cell cell = make_mc_cell(morph, true); + cable_cell cell = make_cable_cell(morph, true); EXPECT_TRUE(cell.has_soma()); EXPECT_EQ(4u, cell.num_segments()); diff --git a/test/unit/test_synapses.cpp b/test/unit/test_synapses.cpp index c433099fa67d0d2c25084bc1e4658ff5ed5642e6..7b46ad4a9d34143eac848562a471244db26824da 100644 --- a/test/unit/test_synapses.cpp +++ b/test/unit/test_synapses.cpp @@ -7,7 +7,7 @@ #include <arbor/constants.hpp> #include <arbor/mechcat.hpp> #include <arbor/util/optional.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include "backends/multicore/fvm.hpp" #include "backends/multicore/mechanism.hpp" @@ -32,7 +32,7 @@ ACCESS_BIND(value_type* multicore::mechanism::*, vec_i_ptr, &multicore::mechanis TEST(synapses, add_to_cell) { using namespace arb; - mc_cell cell; + cable_cell cell; // Soma with diameter 12.6157 um and HH channel auto soma = cell.add_soma(12.6157/2.0); diff --git a/test/unit/test_threading_exceptions.cpp b/test/unit/test_threading_exceptions.cpp index 14569bf2824709fcbb6c78033a738a25618d21fe..c83896406c05b6acf76a07684b7e01ce11a70143 100644 --- a/test/unit/test_threading_exceptions.cpp +++ b/test/unit/test_threading_exceptions.cpp @@ -7,7 +7,7 @@ #include <arbor/recipe.hpp> #include <arbor/simulation.hpp> #include <arbor/context.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/version.hpp> #include "threading/threading.hpp" diff --git a/test/validation/convergence_test.hpp b/test/validation/convergence_test.hpp index e0ee8496241f48343db001a90d41c92275d3fef1..189615bbc551637e1a362e9f0fdb803ee3e52967 100644 --- a/test/validation/convergence_test.hpp +++ b/test/validation/convergence_test.hpp @@ -159,7 +159,7 @@ public: * Extract time points to exclude from current stimulus end-points. */ -inline std::vector<float> stimulus_ends(const mc_cell& c) { +inline std::vector<float> stimulus_ends(const cable_cell& c) { std::vector<float> ts; for (const auto& stimulus: c.stimuli()) { diff --git a/test/validation/validate_ball_and_stick.cpp b/test/validation/validate_ball_and_stick.cpp index 22f12314af8ae0ca1167494e841a290498b87019..a7843adcb7983ae82790557fb30f070be2a64495 100644 --- a/test/validation/validate_ball_and_stick.cpp +++ b/test/validation/validate_ball_and_stick.cpp @@ -7,7 +7,7 @@ #include <arbor/domain_decomposition.hpp> #include <arbor/context.hpp> #include <arbor/load_balance.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/recipe.hpp> #include <arbor/simple_sampler.hpp> #include <arbor/simulation.hpp> @@ -35,7 +35,7 @@ void run_ncomp_convergence_test( const char* model_name, const sup::path& ref_data_path, context& context, - const mc_cell& c, + const cable_cell& c, ProbePointSeq& probe_points, float t_end=100.f) { @@ -89,7 +89,7 @@ void run_ncomp_convergence_test( void validate_ball_and_stick(context& ctx) { using namespace arb; - mc_cell c = make_cell_ball_and_stick(); + cable_cell c = make_cell_ball_and_stick(); probe_point points[] = { {"soma.mid", {0u, 0.5}}, {"dend.mid", {1u, 0.5}}, @@ -107,7 +107,7 @@ void validate_ball_and_stick(context& ctx) { void validate_ball_and_taper(context& ctx) { using namespace arb; - mc_cell c = make_cell_ball_and_taper(); + cable_cell c = make_cell_ball_and_taper(); probe_point points[] = { {"soma.mid", {0u, 0.5}}, {"taper.mid", {1u, 0.5}}, @@ -125,7 +125,7 @@ void validate_ball_and_taper(context& ctx) { void validate_ball_and_3stick(context& ctx) { using namespace arb; - mc_cell c = make_cell_ball_and_3stick(); + cable_cell c = make_cell_ball_and_3stick(); probe_point points[] = { {"soma.mid", {0u, 0.5}}, {"dend1.mid", {1u, 0.5}}, @@ -147,7 +147,7 @@ void validate_ball_and_3stick(context& ctx) { void validate_rallpack1(context& ctx) { using namespace arb; - mc_cell c = make_cell_simple_cable(); + cable_cell c = make_cell_simple_cable(); probe_point points[] = { {"cable.x0.0", {1u, 0.0}}, {"cable.x0.3", {1u, 0.3}}, @@ -166,7 +166,7 @@ void validate_rallpack1(context& ctx) { void validate_ball_and_squiggle(context& ctx) { using namespace arb; - mc_cell c = make_cell_ball_and_squiggle(); + cable_cell c = make_cell_ball_and_squiggle(); probe_point points[] = { {"soma.mid", {0u, 0.5}}, {"dend.mid", {1u, 0.5}}, diff --git a/test/validation/validate_kinetic.cpp b/test/validation/validate_kinetic.cpp index 9bf35611a6159e8d1ac9c8fdc53ffe2dcb622816..57ddd135174af948de68699bccdfa0ff36808e60 100644 --- a/test/validation/validate_kinetic.cpp +++ b/test/validation/validate_kinetic.cpp @@ -8,7 +8,7 @@ #include <arbor/common_types.hpp> #include <arbor/domain_decomposition.hpp> #include <arbor/load_balance.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/recipe.hpp> #include <arbor/simple_sampler.hpp> #include <arbor/simulation.hpp> @@ -23,7 +23,7 @@ void run_kinetic_dt( const arb::context& context, - arb::mc_cell& c, + arb::cable_cell& c, arb::cell_probe_address probe, float t_end, nlohmann::json meta, @@ -71,7 +71,7 @@ void validate_kinetic_kin1(const arb::context& ctx) { using namespace arb; // 20 µm diameter soma with single mechanism, current probe - mc_cell c; + cable_cell c; auto soma = c.add_soma(10); soma->add_mechanism("test_kin1"); cell_probe_address probe{{0, 0.5}, cell_probe_address::membrane_current}; @@ -89,7 +89,7 @@ void validate_kinetic_kinlva(const arb::context& ctx) { using namespace arb; // 20 µm diameter soma with single mechanism, current probe - mc_cell c; + cable_cell c; auto soma = c.add_soma(10); c.add_stimulus({0,0.5}, {20., 130., -0.025}); soma->add_mechanism("test_kinlva"); diff --git a/test/validation/validate_soma.cpp b/test/validation/validate_soma.cpp index 5e5fdd6e91db9079c9753944c10f410e5110991b..6d5c9c6db7e4697b1b8b3cbb03fcb96d1baf6409 100644 --- a/test/validation/validate_soma.cpp +++ b/test/validation/validate_soma.cpp @@ -4,7 +4,7 @@ #include <arbor/context.hpp> #include <arbor/domain_decomposition.hpp> #include <arbor/load_balance.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/recipe.hpp> #include <arbor/simple_sampler.hpp> #include <arbor/simulation.hpp> @@ -24,7 +24,7 @@ using namespace arb; void validate_soma(const context& context) { float sample_dt = g_trace_io.sample_dt(); - mc_cell c = make_cell_soma_only(); + cable_cell c = make_cell_soma_only(); cable1d_recipe rec{c}; rec.add_probe(0, 0, cell_probe_address{{0, 0.5}, cell_probe_address::membrane_voltage}); diff --git a/test/validation/validate_synapses.cpp b/test/validation/validate_synapses.cpp index a72d285a65b543dfa7096e241a53d28600b62ea2..1fd4de8c9020bfeb96b391c26e74881036d2ef60 100644 --- a/test/validation/validate_synapses.cpp +++ b/test/validation/validate_synapses.cpp @@ -3,7 +3,7 @@ #include <arbor/context.hpp> #include <arbor/domain_decomposition.hpp> #include <arbor/load_balance.hpp> -#include <arbor/mc_cell.hpp> +#include <arbor/cable_cell.hpp> #include <arbor/recipe.hpp> #include <arbor/simple_sampler.hpp> #include <arbor/simulation.hpp> @@ -38,7 +38,7 @@ void run_synapse_test( {"backend_kind", arb::has_gpu(context)? "gpu": "multicore"} }; - mc_cell c = make_cell_ball_and_stick(false); // no stimuli + cable_cell c = make_cell_ball_and_stick(false); // no stimuli mechanism_desc syn_default(syn_type); c.add_synapse({1, 0.5}, syn_default);