diff --git a/at_time/neuron/example.cpp b/at_time/neuron/example.cpp index 35fc5cf4..7269f89a 100644 --- a/at_time/neuron/example.cpp +++ b/at_time/neuron/example.cpp @@ -83,6 +83,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); example_Store example_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -245,6 +247,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_example, nullptr, nullptr, nullptr, nrn_init_example, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"v_unused"} /* 0 */ ); diff --git a/cnexp/neuron/cnexp_array.cpp b/cnexp/neuron/cnexp_array.cpp index 5335be30..df7031be 100644 --- a/cnexp/neuron/cnexp_array.cpp +++ b/cnexp/neuron/cnexp_array.cpp @@ -89,6 +89,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); cnexp_array_Store cnexp_array_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -248,6 +250,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_cnexp_array, nullptr, nrn_jacob_cnexp_array, nrn_state_cnexp_array, nrn_init_cnexp_array, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"z", 3} /* 0 */, _nrn_mechanism_field{"x"} /* 1 */, diff --git a/cnexp/neuron/cnexp_scalar.cpp b/cnexp/neuron/cnexp_scalar.cpp index 298fa0cf..0626826e 100644 --- a/cnexp/neuron/cnexp_scalar.cpp +++ b/cnexp/neuron/cnexp_scalar.cpp @@ -86,6 +86,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); cnexp_scalar_Store cnexp_scalar_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -234,6 +236,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_cnexp_scalar, nullptr, nrn_jacob_cnexp_scalar, nrn_state_cnexp_scalar, nrn_init_cnexp_scalar, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"Dx"} /* 1 */, diff --git a/constant/neuron/constant.cpp b/constant/neuron/constant.cpp index b2b63af0..7626fa63 100644 --- a/constant/neuron/constant.cpp +++ b/constant/neuron/constant.cpp @@ -84,6 +84,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); constant_mod_Store constant_mod_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -246,6 +248,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_constant_mod, nullptr, nullptr, nullptr, nrn_init_constant_mod, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"v_unused"} /* 0 */ ); diff --git a/function/neuron/compile_only.cpp b/function/neuron/compile_only.cpp index 5666fece..6e207c6c 100644 --- a/function/neuron/compile_only.cpp +++ b/function/neuron/compile_only.cpp @@ -85,6 +85,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); func_in_breakpoint_Store func_in_breakpoint_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -385,6 +387,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_func_in_breakpoint, nrn_cur_func_in_breakpoint, nrn_jacob_func_in_breakpoint, nrn_state_func_in_breakpoint, nrn_init_func_in_breakpoint, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"il"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */, diff --git a/function/neuron/functions.cpp b/function/neuron/functions.cpp index b8a36ad6..773f77bf 100644 --- a/function/neuron/functions.cpp +++ b/function/neuron/functions.cpp @@ -84,6 +84,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); functions_Store functions_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -335,6 +337,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_functions, nullptr, nullptr, nullptr, nrn_init_functions, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */ diff --git a/function/neuron/point_functions.cpp b/function/neuron/point_functions.cpp index c31c91f7..8c558f04 100644 --- a/function/neuron/point_functions.cpp +++ b/function/neuron/point_functions.cpp @@ -82,6 +82,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); point_functions_Store point_functions_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -320,6 +322,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_point_functions, nullptr, nullptr, nullptr, nrn_init_point_functions, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */, diff --git a/function/neuron/recursion.cpp b/function/neuron/recursion.cpp index c5e030af..79eaf40a 100644 --- a/function/neuron/recursion.cpp +++ b/function/neuron/recursion.cpp @@ -83,6 +83,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); recursion_Store recursion_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -249,6 +251,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_recursion, nullptr, nullptr, nullptr, nrn_init_recursion, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"v_unused"} /* 0 */ ); diff --git a/global/neuron/read_only.cpp b/global/neuron/read_only.cpp index b4c004bb..8884d616 100644 --- a/global/neuron/read_only.cpp +++ b/global/neuron/read_only.cpp @@ -86,6 +86,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); read_only_Store read_only_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -231,6 +233,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_read_only, nullptr, nrn_jacob_read_only, nrn_state_read_only, nrn_init_read_only, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"Dx"} /* 1 */, diff --git a/global/neuron/thread_newton.cpp b/global/neuron/thread_newton.cpp index 7989410e..24662637 100644 --- a/global/neuron/thread_newton.cpp +++ b/global/neuron/thread_newton.cpp @@ -91,6 +91,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); thread_newton_Store thread_newton_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -324,6 +326,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_thread_newton, nullptr, nrn_jacob_thread_newton, nrn_state_thread_newton, nrn_init_thread_newton, hoc_nrnpointerindex, 2); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"X"} /* 1 */, diff --git a/global/neuron/thread_variable.cpp b/global/neuron/thread_variable.cpp index 10b5f98f..fdbf08cc 100644 --- a/global/neuron/thread_variable.cpp +++ b/global/neuron/thread_variable.cpp @@ -94,6 +94,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); shared_global_Store shared_global_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -522,6 +524,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_shared_global, nrn_cur_shared_global, nrn_jacob_shared_global, nrn_state_shared_global, nrn_init_shared_global, hoc_nrnpointerindex, 2); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_thread_table_reg(mech_type, _check_table_thread); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"y"} /* 0 */, diff --git a/global/neuron/top_local.cpp b/global/neuron/top_local.cpp index 7e0ede30..91be5992 100644 --- a/global/neuron/top_local.cpp +++ b/global/neuron/top_local.cpp @@ -88,6 +88,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); top_local_Store top_local_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -301,6 +303,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_top_local, nrn_cur_top_local, nrn_jacob_top_local, nrn_state_top_local, nrn_init_top_local, hoc_nrnpointerindex, 2); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"y"} /* 0 */, _nrn_mechanism_field{"il"} /* 1 */, diff --git a/hodgkin_huxley/neuron/hodhux.cpp b/hodgkin_huxley/neuron/hodhux.cpp index f56b1d3a..12b36981 100644 --- a/hodgkin_huxley/neuron/hodhux.cpp +++ b/hodgkin_huxley/neuron/hodhux.cpp @@ -103,6 +103,12 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); hodhux_Store hodhux_global; + static std::vector _parameter_defaults = { + 0.12 /* gnabar */, + 0.036 /* gkbar */, + 0.0003 /* gl */, + -54.3 /* el */ + }; /** all mechanism instance variables and global variables */ @@ -205,10 +211,10 @@ namespace neuron { size_t const _iml = 0; assert(_nrn_mechanism_get_num_vars(_prop) == 23); /*initialize range parameters*/ - _lmc.template fpfield<0>(_iml) = 0.12; /* gnabar */ - _lmc.template fpfield<1>(_iml) = 0.036; /* gkbar */ - _lmc.template fpfield<2>(_iml) = 0.0003; /* gl */ - _lmc.template fpfield<3>(_iml) = -54.3; /* el */ + _lmc.template fpfield<0>(_iml) = _parameter_defaults[0]; /* gnabar */ + _lmc.template fpfield<1>(_iml) = _parameter_defaults[1]; /* gkbar */ + _lmc.template fpfield<2>(_iml) = _parameter_defaults[2]; /* gl */ + _lmc.template fpfield<3>(_iml) = _parameter_defaults[3]; /* el */ _nrn_mechanism_access_dparam(_prop) = _ppvar; Symbol * na_sym = hoc_lookup("na_ion"); Prop * na_prop = need_memb(na_sym); @@ -534,6 +540,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_hodhux, nrn_cur_hodhux, nrn_jacob_hodhux, nrn_state_hodhux, nrn_init_hodhux, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"gnabar"} /* 0 */, _nrn_mechanism_field{"gkbar"} /* 1 */, diff --git a/kinetic/neuron/X2Y.cpp b/kinetic/neuron/X2Y.cpp index 3fb0e931..5f9951b2 100644 --- a/kinetic/neuron/X2Y.cpp +++ b/kinetic/neuron/X2Y.cpp @@ -92,6 +92,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); X2Y_Store X2Y_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -388,6 +390,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_X2Y, nrn_cur_X2Y, nrn_jacob_X2Y, nrn_state_X2Y, nrn_init_X2Y, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"il"} /* 0 */, _nrn_mechanism_field{"c1"} /* 1 */, diff --git a/morphology/neuron/two_radii.cpp b/morphology/neuron/two_radii.cpp index 92b2da32..0989c0c2 100644 --- a/morphology/neuron/two_radii.cpp +++ b/morphology/neuron/two_radii.cpp @@ -85,6 +85,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); two_radii_Store two_radii_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -352,6 +354,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_two_radii, nrn_cur_two_radii, nrn_jacob_two_radii, nrn_state_two_radii, nrn_init_two_radii, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"il"} /* 0 */, _nrn_mechanism_field{"inv"} /* 1 */, diff --git a/net_event/neuron/receiver.cpp b/net_event/neuron/receiver.cpp index 93b10f5b..3e76428b 100644 --- a/net_event/neuron/receiver.cpp +++ b/net_event/neuron/receiver.cpp @@ -82,6 +82,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); receiver_Store receiver_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -247,6 +249,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_receiver, nullptr, nullptr, nullptr, nrn_init_receiver, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"y"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */, diff --git a/net_event/neuron/spiker.cpp b/net_event/neuron/spiker.cpp index 6aae1fe3..67532de9 100644 --- a/net_event/neuron/spiker.cpp +++ b/net_event/neuron/spiker.cpp @@ -82,6 +82,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); spiker_Store spiker_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -252,6 +254,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_spiker, nullptr, nullptr, nullptr, nrn_init_spiker, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"tnext"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */, diff --git a/net_move/neuron/art_spiker.cpp b/net_move/neuron/art_spiker.cpp index 84a55b9b..f9f3551d 100644 --- a/net_move/neuron/art_spiker.cpp +++ b/net_move/neuron/art_spiker.cpp @@ -83,6 +83,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); art_spiker_Store art_spiker_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -255,6 +257,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_art_spiker, nullptr, nullptr, nullptr, nrn_init_art_spiker, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"y"} /* 0 */, _nrn_mechanism_field{"z"} /* 1 */, diff --git a/net_move/neuron/spiker.cpp b/net_move/neuron/spiker.cpp index e0f83778..3f3383b2 100644 --- a/net_move/neuron/spiker.cpp +++ b/net_move/neuron/spiker.cpp @@ -83,6 +83,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); spiker_Store spiker_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -258,6 +260,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_spiker, nullptr, nullptr, nullptr, nrn_init_spiker, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"y"} /* 0 */, _nrn_mechanism_field{"z"} /* 1 */, diff --git a/net_receive/neuron/NetReceiveCalls.cpp b/net_receive/neuron/NetReceiveCalls.cpp index 5539ecb5..922b0805 100644 --- a/net_receive/neuron/NetReceiveCalls.cpp +++ b/net_receive/neuron/NetReceiveCalls.cpp @@ -83,6 +83,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); NetReceiveCalls_Store NetReceiveCalls_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -313,6 +315,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_NetReceiveCalls, nullptr, nullptr, nullptr, nrn_init_NetReceiveCalls, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"c1"} /* 0 */, _nrn_mechanism_field{"c2"} /* 1 */, diff --git a/net_receive/neuron/snapsyn.cpp b/net_receive/neuron/snapsyn.cpp index afb38450..7c696546 100644 --- a/net_receive/neuron/snapsyn.cpp +++ b/net_receive/neuron/snapsyn.cpp @@ -83,6 +83,9 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); SnapSyn_Store SnapSyn_global; + static std::vector _parameter_defaults = { + 10 /* e */ + }; /** all mechanism instance variables and global variables */ @@ -143,7 +146,7 @@ namespace neuron { size_t const _iml = 0; assert(_nrn_mechanism_get_num_vars(_prop) == 6); /*initialize range parameters*/ - _lmc.template fpfield<0>(_iml) = 10; /* e */ + _lmc.template fpfield<0>(_iml) = _parameter_defaults[0]; /* e */ } _nrn_mechanism_access_dparam(_prop) = _ppvar; } @@ -303,6 +306,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_SnapSyn, nrn_cur_SnapSyn, nrn_jacob_SnapSyn, nrn_state_SnapSyn, nrn_init_SnapSyn, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"e"} /* 0 */, _nrn_mechanism_field{"i"} /* 1 */, diff --git a/net_send/neuron/art_toggle.cpp b/net_send/neuron/art_toggle.cpp index 5cba3b57..b7036040 100644 --- a/net_send/neuron/art_toggle.cpp +++ b/net_send/neuron/art_toggle.cpp @@ -82,6 +82,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); art_toggle_Store art_toggle_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -248,6 +250,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_art_toggle, nullptr, nullptr, nullptr, nrn_init_art_toggle, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"y"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */, diff --git a/net_send/neuron/toggle.cpp b/net_send/neuron/toggle.cpp index 83db9621..847f8ab3 100644 --- a/net_send/neuron/toggle.cpp +++ b/net_send/neuron/toggle.cpp @@ -82,6 +82,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); toggle_Store toggle_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -251,6 +253,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_toggle, nullptr, nullptr, nullptr, nrn_init_toggle, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"y"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */, diff --git a/neuron_variables/neuron/neuron_variables.cpp b/neuron_variables/neuron/neuron_variables.cpp index 0a4fce84..7175b39b 100644 --- a/neuron_variables/neuron/neuron_variables.cpp +++ b/neuron_variables/neuron/neuron_variables.cpp @@ -85,6 +85,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); NeuronVariables_Store NeuronVariables_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -228,6 +230,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_NeuronVariables, nullptr, nrn_jacob_NeuronVariables, nrn_state_NeuronVariables, nrn_init_NeuronVariables, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"range_celsius"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */, diff --git a/nonspecific_current/neuron/leonhard.cpp b/nonspecific_current/neuron/leonhard.cpp index c3ea2569..14ab6816 100644 --- a/nonspecific_current/neuron/leonhard.cpp +++ b/nonspecific_current/neuron/leonhard.cpp @@ -85,6 +85,9 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); leonhard_Store leonhard_global; + static std::vector _parameter_defaults = { + 0.005 /* c */ + }; /** all mechanism instance variables and global variables */ @@ -133,7 +136,7 @@ namespace neuron { size_t const _iml = 0; assert(_nrn_mechanism_get_num_vars(_prop) == 4); /*initialize range parameters*/ - _lmc.template fpfield<0>(_iml) = 0.005; /* c */ + _lmc.template fpfield<0>(_iml) = _parameter_defaults[0]; /* c */ } @@ -257,6 +260,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_leonhard, nrn_cur_leonhard, nrn_jacob_leonhard, nrn_state_leonhard, nrn_init_leonhard, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"c"} /* 0 */, _nrn_mechanism_field{"il"} /* 1 */, diff --git a/parameter/coreneuron/default_parameter.cpp b/parameter/coreneuron/default_parameter.cpp new file mode 100644 index 00000000..de704615 --- /dev/null +++ b/parameter/coreneuron/default_parameter.cpp @@ -0,0 +1,260 @@ +/********************************************************* +Model Name : default_parameter +Filename : default_parameter.mod +NMODL Version : 7.7.0 +Vectorized : true +Threadsafe : true +Created : DATE +Simulator : CoreNEURON +Backend : C++ (api-compatibility) +NMODL Compiler : VERSION +*********************************************************/ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace coreneuron { + #ifndef NRN_PRCELLSTATE + #define NRN_PRCELLSTATE 0 + #endif + + + /** channel information */ + static const char *mechanism_info[] = { + "7.7.0", + "default_parameter", + "x_default_parameter", + "y_default_parameter", + "z_default_parameter", + 0, + 0, + 0, + 0 + }; + + + /** all global variables */ + struct default_parameter_Store { + int reset{}; + int mech_type{}; + double a{0}; + double b{0.1}; + }; + static_assert(std::is_trivially_copy_constructible_v); + static_assert(std::is_trivially_move_constructible_v); + static_assert(std::is_trivially_copy_assignable_v); + static_assert(std::is_trivially_move_assignable_v); + static_assert(std::is_trivially_destructible_v); + default_parameter_Store default_parameter_global; + + + /** all mechanism instance variables and global variables */ + struct default_parameter_Instance { + const double* x{}; + const double* y{}; + const double* z{}; + double* v_unused{}; + default_parameter_Store* global{&default_parameter_global}; + }; + + + /** connect global (scalar) variables to hoc -- */ + static DoubScal hoc_scalar_double[] = { + {"a_default_parameter", &default_parameter_global.a}, + {"b_default_parameter", &default_parameter_global.b}, + {nullptr, nullptr} + }; + + + /** connect global (array) variables to hoc -- */ + static DoubVec hoc_vector_double[] = { + {nullptr, nullptr, 0} + }; + + + static inline int first_pointer_var_index() { + return -1; + } + + + static inline int first_random_var_index() { + return -1; + } + + + static inline int float_variables_size() { + return 4; + } + + + static inline int int_variables_size() { + return 0; + } + + + static inline int get_mech_type() { + return default_parameter_global.mech_type; + } + + + static inline Memb_list* get_memb_list(NrnThread* nt) { + if (!nt->_ml_list) { + return nullptr; + } + return nt->_ml_list[get_mech_type()]; + } + + + static inline void* mem_alloc(size_t num, size_t size, size_t alignment = 16) { + void* ptr; + posix_memalign(&ptr, alignment, num*size); + memset(ptr, 0, size); + return ptr; + } + + + static inline void mem_free(void* ptr) { + free(ptr); + } + + + static inline void coreneuron_abort() { + abort(); + } + + // Allocate instance structure + static void nrn_private_constructor_default_parameter(NrnThread* nt, Memb_list* ml, int type) { + assert(!ml->instance); + assert(!ml->global_variables); + assert(ml->global_variables_size == 0); + auto* const inst = new default_parameter_Instance{}; + assert(inst->global == &default_parameter_global); + ml->instance = inst; + ml->global_variables = inst->global; + ml->global_variables_size = sizeof(default_parameter_Store); + } + + // Deallocate the instance structure + static void nrn_private_destructor_default_parameter(NrnThread* nt, Memb_list* ml, int type) { + auto* const inst = static_cast(ml->instance); + assert(inst); + assert(inst->global); + assert(inst->global == &default_parameter_global); + assert(inst->global == ml->global_variables); + assert(ml->global_variables_size == sizeof(default_parameter_Store)); + delete inst; + ml->instance = nullptr; + ml->global_variables = nullptr; + ml->global_variables_size = 0; + } + + /** initialize mechanism instance variables */ + static inline void setup_instance(NrnThread* nt, Memb_list* ml) { + auto* const inst = static_cast(ml->instance); + assert(inst); + assert(inst->global); + assert(inst->global == &default_parameter_global); + assert(inst->global == ml->global_variables); + assert(ml->global_variables_size == sizeof(default_parameter_Store)); + int pnodecount = ml->_nodecount_padded; + Datum* indexes = ml->pdata; + inst->x = ml->data+0*pnodecount; + inst->y = ml->data+1*pnodecount; + inst->z = ml->data+2*pnodecount; + inst->v_unused = ml->data+3*pnodecount; + } + + + + static void nrn_alloc_default_parameter(double* data, Datum* indexes, int type) { + // do nothing + } + + + void nrn_constructor_default_parameter(NrnThread* nt, Memb_list* ml, int type) { + #ifndef CORENEURON_BUILD + int nodecount = ml->nodecount; + int pnodecount = ml->_nodecount_padded; + const int* node_index = ml->nodeindices; + double* data = ml->data; + const double* voltage = nt->_actual_v; + Datum* indexes = ml->pdata; + ThreadDatum* thread = ml->_thread; + auto* const inst = static_cast(ml->instance); + + #endif + } + + + void nrn_destructor_default_parameter(NrnThread* nt, Memb_list* ml, int type) { + #ifndef CORENEURON_BUILD + int nodecount = ml->nodecount; + int pnodecount = ml->_nodecount_padded; + const int* node_index = ml->nodeindices; + double* data = ml->data; + const double* voltage = nt->_actual_v; + Datum* indexes = ml->pdata; + ThreadDatum* thread = ml->_thread; + auto* const inst = static_cast(ml->instance); + + #endif + } + + + /** initialize channel */ + void nrn_init_default_parameter(NrnThread* nt, Memb_list* ml, int type) { + int nodecount = ml->nodecount; + int pnodecount = ml->_nodecount_padded; + const int* node_index = ml->nodeindices; + double* data = ml->data; + const double* voltage = nt->_actual_v; + Datum* indexes = ml->pdata; + ThreadDatum* thread = ml->_thread; + + setup_instance(nt, ml); + auto* const inst = static_cast(ml->instance); + + if (_nrn_skip_initmodel == 0) { + #pragma omp simd + #pragma ivdep + for (int id = 0; id < nodecount; id++) { + int node_id = node_index[id]; + double v = voltage[node_id]; + #if NRN_PRCELLSTATE + inst->v_unused[id] = v; + #endif + } + } + } + + + /** register channel with the simulator */ + void _default_parameter_reg() { + + int mech_type = nrn_get_mechtype("default_parameter"); + default_parameter_global.mech_type = mech_type; + if (mech_type == -1) { + return; + } + + _nrn_layout_reg(mech_type, 0); + register_mech(mechanism_info, nrn_alloc_default_parameter, nullptr, nullptr, nullptr, nrn_init_default_parameter, nrn_private_constructor_default_parameter, nrn_private_destructor_default_parameter, first_pointer_var_index(), 1); + + hoc_register_prop_size(mech_type, float_variables_size(), int_variables_size()); + hoc_register_var(hoc_scalar_double, hoc_vector_double, NULL); + } +} diff --git a/parameter/neuron/default_parameter.cpp b/parameter/neuron/default_parameter.cpp new file mode 100644 index 00000000..ccd13720 --- /dev/null +++ b/parameter/neuron/default_parameter.cpp @@ -0,0 +1,239 @@ +/********************************************************* +Model Name : default_parameter +Filename : default_parameter.mod +NMODL Version : 7.7.0 +Vectorized : true +Threadsafe : true +Created : DATE +Simulator : NEURON +Backend : C++ (api-compatibility) +NMODL Compiler : VERSION +*********************************************************/ + +#include +#include +#include +#include +#include +#include + +#include "mech_api.h" +#include "neuron/cache/mechanism_range.hpp" +#include "nrniv_mf.h" +#include "section_fwd.hpp" + +/* NEURON global macro definitions */ +/* VECTORIZED */ +#define NRN_VECTORIZED 1 + +static constexpr auto number_of_datum_variables = 0; +static constexpr auto number_of_floating_point_variables = 4; + +namespace { +template +using _nrn_mechanism_std_vector = std::vector; +using _nrn_model_sorted_token = neuron::model_sorted_token; +using _nrn_mechanism_cache_range = neuron::cache::MechanismRange; +using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance; +using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container; +template +using _nrn_mechanism_field = neuron::mechanism::field; +template +void _nrn_mechanism_register_data_fields(Args&&... args) { + neuron::mechanism::register_data_fields(std::forward(args)...); +} +} // namespace + +Prop* hoc_getdata_range(int type); +extern Node* nrn_alloc_node_; + + +namespace neuron { + #ifndef NRN_PRCELLSTATE + #define NRN_PRCELLSTATE 0 + #endif + + + /** channel information */ + static const char *mechanism_info[] = { + "7.7.0", + "default_parameter", + "x_default_parameter", + "y_default_parameter", + "z_default_parameter", + 0, + 0, + 0, + 0 + }; + + + /* NEURON global variables */ + static int mech_type; + static Prop* _extcall_prop; + /* _prop_id kind of shadows _extcall_prop to allow validity checking. */ + static _nrn_non_owning_id_without_container _prop_id{}; + static int hoc_nrnpointerindex = -1; + static _nrn_mechanism_std_vector _extcall_thread; + + + /** all global variables */ + struct default_parameter_Store { + double a{0}; + double b{0.1}; + }; + static_assert(std::is_trivially_copy_constructible_v); + static_assert(std::is_trivially_move_constructible_v); + static_assert(std::is_trivially_copy_assignable_v); + static_assert(std::is_trivially_move_assignable_v); + static_assert(std::is_trivially_destructible_v); + default_parameter_Store default_parameter_global; + static std::vector _parameter_defaults = { + 0 /* x */, + 2.1 /* y */, + 0 /* z */ + }; + + + /** all mechanism instance variables and global variables */ + struct default_parameter_Instance { + double* x{}; + double* y{}; + double* z{}; + double* v_unused{}; + default_parameter_Store* global{&default_parameter_global}; + }; + + + struct default_parameter_NodeData { + int const * nodeindices; + double const * node_voltages; + double * node_diagonal; + double * node_rhs; + int nodecount; + }; + + + static default_parameter_Instance make_instance_default_parameter(_nrn_mechanism_cache_range& _lmc) { + return default_parameter_Instance { + _lmc.template fpfield_ptr<0>(), + _lmc.template fpfield_ptr<1>(), + _lmc.template fpfield_ptr<2>(), + _lmc.template fpfield_ptr<3>() + }; + } + + + static default_parameter_NodeData make_node_data_default_parameter(NrnThread& nt, Memb_list& _ml_arg) { + return default_parameter_NodeData { + _ml_arg.nodeindices, + nt.node_voltage_storage(), + nt.node_d_storage(), + nt.node_rhs_storage(), + _ml_arg.nodecount + }; + } + + + static void nrn_alloc_default_parameter(Prop* _prop) { + Datum *_ppvar = nullptr; + _nrn_mechanism_cache_instance _lmc{_prop}; + size_t const _iml = 0; + assert(_nrn_mechanism_get_num_vars(_prop) == 4); + /*initialize range parameters*/ + _lmc.template fpfield<0>(_iml) = _parameter_defaults[0]; /* x */ + _lmc.template fpfield<1>(_iml) = _parameter_defaults[1]; /* y */ + _lmc.template fpfield<2>(_iml) = _parameter_defaults[2]; /* z */ + } + + + /* Neuron setdata functions */ + extern void _nrn_setdata_reg(int, void(*)(Prop*)); + static void _setdata(Prop* _prop) { + _extcall_prop = _prop; + _prop_id = _nrn_get_prop_id(_prop); + } + static void _hoc_setdata() { + Prop *_prop = hoc_getdata_range(mech_type); + _setdata(_prop); + hoc_retpushx(1.); + } + /* Mechanism procedures and functions */ + + + /** connect global (scalar) variables to hoc -- */ + static DoubScal hoc_scalar_double[] = { + {"a_default_parameter", &default_parameter_global.a}, + {"b_default_parameter", &default_parameter_global.b}, + {nullptr, nullptr} + }; + + + /** connect global (array) variables to hoc -- */ + static DoubVec hoc_vector_double[] = { + {nullptr, nullptr, 0} + }; + + + /* declaration of user functions */ + + + /* connect user functions to hoc names */ + static VoidFunc hoc_intfunc[] = { + {"setdata_default_parameter", _hoc_setdata}, + {nullptr, nullptr} + }; + static NPyDirectMechFunc npy_direct_func_proc[] = { + {nullptr, nullptr} + }; + + + void nrn_init_default_parameter(const _nrn_model_sorted_token& _sorted_token, NrnThread* nt, Memb_list* _ml_arg, int _type) { + _nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type}; + auto inst = make_instance_default_parameter(_lmc); + auto node_data = make_node_data_default_parameter(*nt, *_ml_arg); + auto nodecount = _ml_arg->nodecount; + auto* _thread = _ml_arg->_thread; + for (int id = 0; id < nodecount; id++) { + auto* _ppvar = _ml_arg->pdata[id]; + int node_id = node_data.nodeindices[id]; + auto v = node_data.node_voltages[node_id]; + inst.v_unused[id] = v; + } + } + + + static void nrn_jacob_default_parameter(const _nrn_model_sorted_token& _sorted_token, NrnThread* nt, Memb_list* _ml_arg, int _type) { + _nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type}; + auto inst = make_instance_default_parameter(_lmc); + auto node_data = make_node_data_default_parameter(*nt, *_ml_arg); + auto nodecount = _ml_arg->nodecount; + for (int id = 0; id < nodecount; id++) { + } + } + + + static void _initlists() { + } + + + /** register channel with the simulator */ + extern "C" void _default_parameter_reg() { + _initlists(); + + register_mech(mechanism_info, nrn_alloc_default_parameter, nullptr, nullptr, nullptr, nrn_init_default_parameter, hoc_nrnpointerindex, 1); + + mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); + _nrn_mechanism_register_data_fields(mech_type, + _nrn_mechanism_field{"x"} /* 0 */, + _nrn_mechanism_field{"y"} /* 1 */, + _nrn_mechanism_field{"z"} /* 2 */, + _nrn_mechanism_field{"v_unused"} /* 3 */ + ); + + hoc_register_prop_size(mech_type, 4, 0); + hoc_register_var(hoc_scalar_double, hoc_vector_double, hoc_intfunc); + hoc_register_npy_direct(mech_type, npy_direct_func_proc); + } +} diff --git a/parameter/neuron/range_parameter.cpp b/parameter/neuron/range_parameter.cpp index e8347da3..87c387f8 100644 --- a/parameter/neuron/range_parameter.cpp +++ b/parameter/neuron/range_parameter.cpp @@ -83,6 +83,10 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); range_parameter_Store range_parameter_global; + static std::vector _parameter_defaults = { + 42 /* x */, + 0 /* y */ + }; /** all mechanism instance variables and global variables */ @@ -137,8 +141,8 @@ namespace neuron { size_t const _iml = 0; assert(_nrn_mechanism_get_num_vars(_prop) == 3); /*initialize range parameters*/ - _lmc.template fpfield<0>(_iml) = 42; /* x */ - _lmc.template fpfield<1>(_iml) = 0; /* y */ + _lmc.template fpfield<0>(_iml) = _parameter_defaults[0]; /* x */ + _lmc.template fpfield<1>(_iml) = _parameter_defaults[1]; /* y */ } _nrn_mechanism_access_dparam(_prop) = _ppvar; } @@ -236,6 +240,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_range_parameter, nullptr, nullptr, nullptr, nrn_init_range_parameter, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"y"} /* 1 */, diff --git a/point_process/neuron/pp.cpp b/point_process/neuron/pp.cpp index 2e022e5b..15566702 100644 --- a/point_process/neuron/pp.cpp +++ b/point_process/neuron/pp.cpp @@ -81,6 +81,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); pp_Store pp_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -227,6 +229,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_pp, nullptr, nullptr, nullptr, nrn_init_pp, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"v_unused"} /* 0 */, _nrn_mechanism_field{"node_area", "area"} /* 0 */, diff --git a/procedure/neuron/point_procedures.cpp b/procedure/neuron/point_procedures.cpp index 32edc029..4badf959 100644 --- a/procedure/neuron/point_procedures.cpp +++ b/procedure/neuron/point_procedures.cpp @@ -82,6 +82,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); point_procedures_Store point_procedures_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -446,6 +448,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_point_procedures, nullptr, nullptr, nullptr, nrn_init_point_procedures, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */, diff --git a/procedure/neuron/procedures.cpp b/procedure/neuron/procedures.cpp index f7ca8736..db400b72 100644 --- a/procedure/neuron/procedures.cpp +++ b/procedure/neuron/procedures.cpp @@ -84,6 +84,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); procedures_Store procedures_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -530,6 +532,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_procedures, nullptr, nullptr, nullptr, nrn_init_procedures, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */ diff --git a/spike_travel/neuron/expsyn2.cpp b/spike_travel/neuron/expsyn2.cpp index bcd7182d..e87a2914 100644 --- a/spike_travel/neuron/expsyn2.cpp +++ b/spike_travel/neuron/expsyn2.cpp @@ -87,6 +87,10 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); ExpSyn2_Store ExpSyn2_global; + static std::vector _parameter_defaults = { + 0.1 /* tau */, + 0 /* e */ + }; /** all mechanism instance variables and global variables */ @@ -151,8 +155,8 @@ namespace neuron { size_t const _iml = 0; assert(_nrn_mechanism_get_num_vars(_prop) == 8); /*initialize range parameters*/ - _lmc.template fpfield<0>(_iml) = 0.1; /* tau */ - _lmc.template fpfield<1>(_iml) = 0; /* e */ + _lmc.template fpfield<0>(_iml) = _parameter_defaults[0]; /* tau */ + _lmc.template fpfield<1>(_iml) = _parameter_defaults[1]; /* e */ } _nrn_mechanism_access_dparam(_prop) = _ppvar; } @@ -317,6 +321,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_ExpSyn2, nrn_cur_ExpSyn2, nrn_jacob_ExpSyn2, nrn_state_ExpSyn2, nrn_init_ExpSyn2, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"tau"} /* 0 */, _nrn_mechanism_field{"e"} /* 1 */, diff --git a/spike_travel/neuron/hodhux.cpp b/spike_travel/neuron/hodhux.cpp index f56b1d3a..12b36981 100644 --- a/spike_travel/neuron/hodhux.cpp +++ b/spike_travel/neuron/hodhux.cpp @@ -103,6 +103,12 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); hodhux_Store hodhux_global; + static std::vector _parameter_defaults = { + 0.12 /* gnabar */, + 0.036 /* gkbar */, + 0.0003 /* gl */, + -54.3 /* el */ + }; /** all mechanism instance variables and global variables */ @@ -205,10 +211,10 @@ namespace neuron { size_t const _iml = 0; assert(_nrn_mechanism_get_num_vars(_prop) == 23); /*initialize range parameters*/ - _lmc.template fpfield<0>(_iml) = 0.12; /* gnabar */ - _lmc.template fpfield<1>(_iml) = 0.036; /* gkbar */ - _lmc.template fpfield<2>(_iml) = 0.0003; /* gl */ - _lmc.template fpfield<3>(_iml) = -54.3; /* el */ + _lmc.template fpfield<0>(_iml) = _parameter_defaults[0]; /* gnabar */ + _lmc.template fpfield<1>(_iml) = _parameter_defaults[1]; /* gkbar */ + _lmc.template fpfield<2>(_iml) = _parameter_defaults[2]; /* gl */ + _lmc.template fpfield<3>(_iml) = _parameter_defaults[3]; /* el */ _nrn_mechanism_access_dparam(_prop) = _ppvar; Symbol * na_sym = hoc_lookup("na_ion"); Prop * na_prop = need_memb(na_sym); @@ -534,6 +540,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_hodhux, nrn_cur_hodhux, nrn_jacob_hodhux, nrn_state_hodhux, nrn_init_hodhux, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"gnabar"} /* 0 */, _nrn_mechanism_field{"gkbar"} /* 1 */, diff --git a/suffix/neuron/no_suffix.cpp b/suffix/neuron/no_suffix.cpp index 9651911d..3d88bb2b 100644 --- a/suffix/neuron/no_suffix.cpp +++ b/suffix/neuron/no_suffix.cpp @@ -84,6 +84,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); no_suffix_Store no_suffix_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -207,6 +209,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_no_suffix, nullptr, nullptr, nullptr, nrn_init_no_suffix, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */ diff --git a/suffix/neuron/point_suffix.cpp b/suffix/neuron/point_suffix.cpp index 32f67430..c3fb2f68 100644 --- a/suffix/neuron/point_suffix.cpp +++ b/suffix/neuron/point_suffix.cpp @@ -82,6 +82,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); point_suffix_Store point_suffix_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -231,6 +233,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_point_suffix, nullptr, nullptr, nullptr, nrn_init_point_suffix, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */, diff --git a/table/neuron/table.cpp b/table/neuron/table.cpp index 3bd481fe..5fed437d 100644 --- a/table/neuron/table.cpp +++ b/table/neuron/table.cpp @@ -103,6 +103,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); tbl_Store tbl_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -592,6 +594,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_tbl, nrn_cur_tbl, nrn_jacob_tbl, nrn_state_tbl, nrn_init_tbl, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_thread_table_reg(mech_type, _check_table_thread); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"g"} /* 0 */, diff --git a/table/neuron/table_point_process.cpp b/table/neuron/table_point_process.cpp index 56aeed2c..3b75e19b 100644 --- a/table/neuron/table_point_process.cpp +++ b/table/neuron/table_point_process.cpp @@ -101,6 +101,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); tbl_point_process_Store tbl_point_process_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -575,6 +577,7 @@ namespace neuron { _pointtype = point_register_mech(mechanism_info, nrn_alloc_tbl_point_process, nrn_cur_tbl_point_process, nrn_jacob_tbl_point_process, nrn_state_tbl_point_process, nrn_init_tbl_point_process, hoc_nrnpointerindex, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_thread_table_reg(mech_type, _check_table_thread); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"g"} /* 0 */, diff --git a/useion/neuron/ionic.cpp b/useion/neuron/ionic.cpp index 34360888..eae8c5c1 100644 --- a/useion/neuron/ionic.cpp +++ b/useion/neuron/ionic.cpp @@ -84,6 +84,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); ionic_Store ionic_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -247,6 +249,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_ionic, nullptr, nrn_jacob_ionic, nrn_state_ionic, nrn_init_ionic, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"ina"} /* 0 */, _nrn_mechanism_field{"ena"} /* 1 */, diff --git a/useion/neuron/read_cai.cpp b/useion/neuron/read_cai.cpp index d894483c..0ec16dff 100644 --- a/useion/neuron/read_cai.cpp +++ b/useion/neuron/read_cai.cpp @@ -85,6 +85,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); read_cai_Store read_cai_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -227,6 +229,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_read_cai, nullptr, nullptr, nullptr, nrn_init_read_cai, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"cai"} /* 1 */, diff --git a/useion/neuron/read_cao.cpp b/useion/neuron/read_cao.cpp index d0e0829f..ef14043b 100644 --- a/useion/neuron/read_cao.cpp +++ b/useion/neuron/read_cao.cpp @@ -85,6 +85,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); read_cao_Store read_cao_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -227,6 +229,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_read_cao, nullptr, nullptr, nullptr, nrn_init_read_cao, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"cao"} /* 1 */, diff --git a/useion/neuron/read_eca.cpp b/useion/neuron/read_eca.cpp index c0091618..ae66cbf5 100644 --- a/useion/neuron/read_eca.cpp +++ b/useion/neuron/read_eca.cpp @@ -85,6 +85,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); read_eca_Store read_eca_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -224,6 +226,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_read_eca, nullptr, nullptr, nullptr, nrn_init_read_eca, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"eca"} /* 1 */, diff --git a/useion/neuron/style_ion.cpp b/useion/neuron/style_ion.cpp index 18778ce7..2b37d76b 100644 --- a/useion/neuron/style_ion.cpp +++ b/useion/neuron/style_ion.cpp @@ -85,6 +85,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); style_ion_Store style_ion_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -253,6 +255,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_style_ion, nullptr, nullptr, nullptr, nrn_init_style_ion, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"cai"} /* 0 */, _nrn_mechanism_field{"eca"} /* 1 */, diff --git a/useion/neuron/valence.cpp b/useion/neuron/valence.cpp index 150a70d2..79d0de6d 100644 --- a/useion/neuron/valence.cpp +++ b/useion/neuron/valence.cpp @@ -85,6 +85,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); valence_mod_Store valence_mod_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -227,6 +229,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_valence_mod, nullptr, nullptr, nullptr, nrn_init_valence_mod, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"x"} /* 0 */, _nrn_mechanism_field{"Ki"} /* 1 */, diff --git a/useion/neuron/write_cai.cpp b/useion/neuron/write_cai.cpp index 2c92ca12..4f044f30 100644 --- a/useion/neuron/write_cai.cpp +++ b/useion/neuron/write_cai.cpp @@ -84,6 +84,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); write_cai_Store write_cai_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -232,6 +234,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_write_cai, nullptr, nullptr, nullptr, nrn_init_write_cai, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"cai"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */, diff --git a/useion/neuron/write_cao.cpp b/useion/neuron/write_cao.cpp index 18b254b5..ad14112a 100644 --- a/useion/neuron/write_cao.cpp +++ b/useion/neuron/write_cao.cpp @@ -84,6 +84,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); write_cao_Store write_cao_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -232,6 +234,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_write_cao, nullptr, nullptr, nullptr, nrn_init_write_cao, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"cao"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */, diff --git a/useion/neuron/write_eca.cpp b/useion/neuron/write_eca.cpp index 34d47f96..4020f9fa 100644 --- a/useion/neuron/write_eca.cpp +++ b/useion/neuron/write_eca.cpp @@ -84,6 +84,8 @@ namespace neuron { static_assert(std::is_trivially_move_assignable_v); static_assert(std::is_trivially_destructible_v); write_eca_Store write_eca_global; + static std::vector _parameter_defaults = { + }; /** all mechanism instance variables and global variables */ @@ -221,6 +223,7 @@ namespace neuron { register_mech(mechanism_info, nrn_alloc_write_eca, nullptr, nullptr, nullptr, nrn_init_write_eca, hoc_nrnpointerindex, 1); mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); _nrn_mechanism_register_data_fields(mech_type, _nrn_mechanism_field{"eca"} /* 0 */, _nrn_mechanism_field{"v_unused"} /* 1 */,