-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin_main.cpp
1065 lines (949 loc) · 52.4 KB
/
plugin_main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) 2009-2019: G-CSC, Goethe University Frankfurt
*
* Authors: Markus Breit, Pascal Gottmann
* Creation date: 2014-09-02
*
* This file is part of NeuroBox, which is based on UG4.
*
* NeuroBox and UG4 are free software: You can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3
* (as published by the Free Software Foundation) with the following additional
* attribution requirements (according to LGPL/GPL v3 §7):
*
* (1) The following notice must be displayed in the appropriate legal notices
* of covered and combined works: "Based on UG4 (www.ug4.org/license)".
*
* (2) The following notice must be displayed at a prominent place in the
* terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
*
* (3) The following bibliography is recommended for citation and must be
* preserved in all covered files:
* "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
* parallel geometric multigrid solver on hierarchically distributed grids.
* Computing and visualization in science 16, 4 (2013), 151-164"
* "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
* flexible software system for simulating PDE based models on high performance
* computers. Computing and visualization in science 16, 4 (2013), 165-179"
* "Stepniewski, M., Breit, M., Hoffer, M. and Queisser, G.
* NeuroBox: computational mathematics in multiscale neuroscience.
* Computing and visualization in science (2019).
* "Breit, M. et al. Anatomically detailed and large-scale simulations studying
* synapse loss and synchrony using NeuroBox. Front. Neuroanat. 10 (2016), 8"
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
#include "bridge/util.h"
#include "bridge/util_domain_dependent.h"
#include "bridge/util_domain_algebra_dependent.h"
#include "cable_disc/cable_equation.h"
#include "cable_disc/cable_equation_withOuterPot.h"
#include "cable_disc/implicit_active_cable_disc.h"
#include "cable_disc/implicit_active_cable_disc_base.h"
#include "cable_disc/implicit_active_cable_disc_nernst.h"
#include "lib_grid/global_attachments.h" // global attachments
#include "lib_disc/function_spaces/grid_function.h"
#ifdef UG_PARALLEL
#include "lib_disc/parallelization/domain_load_balancer.h" // for DomainPartitioner
#endif
// configuration file for compile options
#include "cn_config.h"
// cable equation includes
#include "membrane_transport/cable_membrane_transport_interface.h"
// solver includes
#include "util/cable_ass_tuner.h"
#include "util/diam_attachment_handler.h"
#include "util/order.h"
#include "util/neuronal_topology_importer.h"
// implemented membrane transporters
#include "membrane_transport/channel_hh.h"
#include "membrane_transport/leakage.h"
#include "membrane_transport/vdcc_bg.h"
#include "membrane_transport/ion_leakage.h"
#include "membrane_transport/na_k_pump.h"
#include "membrane_transport/ncx.h"
#include "membrane_transport/pmca.h"
#include "membrane_transport/ka_golding01.h"
#include "membrane_transport/kdr_golding01.h"
#include "membrane_transport/nax_golding01.h"
// synapse handling
#include "synapse_handling/synapses/base_synapse.h"
#include "synapse_handling/synapse_info_io_traits.h"
#include "synapse_handling/synapses/onset_pre_synapse.h"
#include "synapse_handling/synapses/alpha_post_synapse.h"
#include "synapse_handling/synapses/threshold_pre_synapse.h"
#include "synapse_handling/synapses/exp2_post_synapse.h"
#include "synapse_handling/synapse_dealer.h"
#include "synapse_handling/synapse_distributor.h"
#include "synapse_handling/synapse_container.h"
#include "synapse_handling/synapse_handler.h"
// utility
#include "util/functions.h"
// partitioning
#ifdef UG_PARALLEL
#include "util/simple_cable_neuron_partitioner.h"
#endif
#ifdef NC_WITH_PARMETIS
#include "util/cable_neuron_unificator.h"
#endif
using namespace std;
using namespace ug::bridge;
namespace ug {
namespace cable_neuron {
/**
* \defgroup plugin_cable_neuron Plugin cable_neuon
* \ingroup plugins_experimental
* This is a plugin for cable equation functionality.
* \{
*/
/**
* Class exporting the functionality. All functionality that is to
* be used in scripts or visualization must be registered here.
*/
struct Functionality
{
/**
* Function called for the registration of Domain dependent parts
* of the plugin. All Functions and Classes depending on the Domain
* are to be placed here when registering. The method is called for all
* available Domain types, based on the current build options.
*
* @param reg registry
* @param parentGroup group for sorting of functionality
*/
template <typename TDomain>
static void Domain(Registry& reg, string grp)
{
static const int dim = TDomain::dim;
string suffix = GetDomainSuffix<TDomain>();
string tag = GetDomainTag<TDomain>();
// ////////////////////////////////////
// //////// cable disc ////////////////
// ////////////////////////////////////
// fully implicit cable equation (base class)
{
typedef ImplicitActiveCableDiscBase<TDomain> T;
typedef IElemDisc<TDomain> TBase;
string name = string("ElemDiscHH_Base").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.add_method("set_spec_cap", static_cast<void (T::*)(number)>(&T::set_spec_cap), "", "specific capacitance (in F/m^2)")
.add_method("set_spec_cap", static_cast<void (T::*)(SmartPtr<CplUserData<number, dim> >)>(&T::set_spec_cap), "", "specific capacitance (in F/m^2) function")
#if defined(UG_FOR_LUA) && !defined(UG_FOR_VRL)
.add_method("set_spec_cap", static_cast<void (T::*)(const char*)>(&T::set_spec_cap), "", "specific capacitance (in F/m^2) function name")
#endif
.add_method("set_spec_res", static_cast<void (T::*)(number)>(&T::set_spec_res), "", "specific resistance (in Ohm m)")
.add_method("set_spec_res", static_cast<void (T::*)(SmartPtr<CplUserData<number, dim> >)>(&T::set_spec_res), "", "specific resistance (in Ohm m) function")
#if defined(UG_FOR_LUA) && !defined(UG_FOR_VRL)
.add_method("set_spec_res", static_cast<void (T::*)(const char*)>(&T::set_spec_res), "", "specific resistance (in Ohm m) function name")
#endif
.add_method("set_conductances", static_cast<void (T::*)(number, number, number)>(&T::set_conductances), "", "conductances for K+, Na+ and leakage (in S/m^2)")
.add_method("set_conductances", static_cast<void (T::*)(SmartPtr<CplUserData<number, dim> >, SmartPtr<CplUserData<number, dim> >, SmartPtr<CplUserData<number, dim> >)>(&T::set_conductances), "", "conductance functions for K+, Na+ and leakage (in S/m^2)")
#if defined(UG_FOR_LUA) && !defined(UG_FOR_VRL)
.add_method("set_conductances", static_cast<void (T::*)(const char*, const char* , const char*)>(&T::set_conductances), "", "conductance function names for K+, Na+ and leakage (in S/m^2)")
#endif
.add_method("set_rev_pot", static_cast<void (T::*)(number, number, number)>(&T::set_rev_pot), "", "reversal potentials (in V) for K+, Na+ and leakage")
.add_method("set_rev_pot", static_cast<void (T::*)(SmartPtr<CplUserData<number, dim> >, SmartPtr<CplUserData<number, dim> >, SmartPtr<CplUserData<number, dim> >)>(&T::set_rev_pot), "", "reversal potential (in V) functions for K+, Na+ and leakage")
#if defined(UG_FOR_LUA) && !defined(UG_FOR_VRL)
.add_method("set_rev_pot", static_cast<void (T::*)(const char*, const char* , const char*)>(&T::set_rev_pot), "", "reversal potential (in V) function names for K+, Na+ and leakage")
#endif
.add_method("set_diameter", &T::set_diameter, "", "constant diameter (in m)")
.add_method("set_injection", &T::set_injection, "", "injection current (in A/m^2)")
.add_method("set_temperature", &T::set_temperature, "", "temperature (in K)")
.add_method("enable_temperature_dependency", &T::enable_temperature_dependency,
"", "whether gating change rates are to be temperature-dependent");
reg.add_class_to_group(name, "ElemDiscHH_Base", tag);
}
// fully implicit cable discretization with constant reversal potential for K and Na
{
typedef ImplicitActiveCableDisc<TDomain> T;
typedef ImplicitActiveCableDiscBase<TDomain> TBase;
string name = string("ImplicitActiveCableDisc").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*) (const char*, const char*)>("function(s) # subset(s)")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "ImplicitActiveCableDisc", tag);
}
// Kabel Diff FV1 with dynamically calculated K+ and Na+ Nernst potentials
{
typedef ImplicitActiveCableDiscNernst<TDomain> T;
typedef ImplicitActiveCableDiscBase<TDomain> TBase;
string name = string("ImplicitActiveCableDiscNernst").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("function(s) # subset(s)")
.add_method("set_diffusion_constants", &T::set_diffusion_constants)
.add_method("set_outside_concs", &T::set_outside_concs)
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "ImplicitActiveCableDiscNernst", tag);
}
// Channel Interface Base (virtual class)
{
typedef ICableMembraneTransport<TDomain> T;
string name = string("ICableMembraneTransport").append(suffix);
reg.add_class_<T>(name, grp);
//.add_method("init", &T::init)
//.add_method("update_gating", &T::update_gating);
reg.add_class_to_group(name, "ICableMembraneTransport", tag);
}
// HH
{
typedef ChannelHH<TDomain> T;
typedef ICableMembraneTransport<TDomain> TBase;
string name = string("ChannelHH").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s)#Subset(s)")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s)#Subset(s)")
.add_method("set_conductances", static_cast<void (T::*)(number, number)>(&T::set_conductances), "",
"K conductance (S/m^2)| default | value=3.6e2#"
"Na conductance (S/m^2) | default | value=1.2e3",
"sets Na and K conductance values for HH mechanism")
.add_method("set_conductances", static_cast<void (T::*)(number, number, const char*)>(&T::set_conductances), "",
"K conductance (S/m^2) | default | value=3.6e2#"
"Na conductance (S/m^2) | default | value=1.2e3#"
"subset(s) as C-type string",
"sets Na and K conductance values for HH mechanism")
.add_method("set_conductances", static_cast<void (T::*)(number, number, const std::vector<std::string>&)>(&T::set_conductances), "",
"K conductance (S/m^2) | default | value=3.6e2#"
"Na conductance (S/m^2) | default | value=1.2e3#"
"subset(s) as vector of string",
"sets Na and K conductance values for HH mechanism")
.add_method("enable_temperature_dependency", &T::enable_temperature_dependency)
.add_method("set_log_mGate", &T::set_log_mGate)
.add_method("set_log_nGate", &T::set_log_nGate)
.add_method("set_log_hGate", &T::set_log_hGate)
//.add_method("current", /*static_cast<void (TBase::*) (Vertex*, std::vector<>&)> (&T::current) /*, "","", "doing flux")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "ChannelHH", tag);
}
// HH-with-Nernst
{
typedef ChannelHHNernst<TDomain> T;
typedef ICableMembraneTransport<TDomain> TBase;
string name = string("ChannelHHNernst").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s)#Subset(s)")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s)#Subset(s)")
.add_method("set_conductances", static_cast<void (T::*)(number, number)>(&T::set_conductances), "",
"K conductance (S/m^2) | default | value=3.6e2#"
"Na conductance (S/m^2) | default | value=1.2e3",
"sets Na and K conductance values for HH mechanism")
.add_method("set_conductances", static_cast<void (T::*)(number, number, const char*)>(&T::set_conductances), "",
"K conductance (S/m^2) | default | value=3.6e2#"
"Na conductance (S/m^2) | default | value=1.2e3#"
"subset(s) as C-type string",
"sets Na and K conductance values for HH mechanism")
.add_method("set_conductances", static_cast<void (T::*)(number, number, const std::vector<std::string>&)>(&T::set_conductances), "",
"K conductance (S/m^2) | default | value=3.6e2#"
"Na conductance (S/m^2) | default | value=1.2e3#"
"subset(s) as vector of string",
"sets Na and K conductance values for HH mechanism")
.add_method("set_log_mGate", &T::set_log_mGate)
.add_method("set_log_nGate", &T::set_log_nGate)
.add_method("set_log_hGate", &T::set_log_hGate)
//.add_method("current", /*static_cast<void (TBase::*) (Vertex*, std::vector<>&)> (*/&T::current) /*, "","", "doing flux")*/
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "ChannelHHNernst", tag);
}
// charge leakage
{
typedef ChannelLeak<TDomain> T;
typedef ICableMembraneTransport<TDomain> TBase;
string name = string("ChannelLeak").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s)#Subset(s)")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s)#Subset(s)")
.add_method("set_cond", static_cast<void (T::*)(number)>(&T::set_cond),
"", "leak conductance (S/m^2) | default | value=1.0",
"sets leak conductance for leakage")
.add_method("set_cond", static_cast<void (T::*)(number, const char*)>(&T::set_cond),
"", "leak conductance (S/m^2) | default | value=1.0 # subset(s) as C-type string",
"sets leak conductance for leakage")
.add_method("set_cond", static_cast<void (T::*)(number, const std::vector<std::string>&)>(&T::set_cond),
"", "leak conductance (S/m^2) | default | value=1.0 # subset(s) as vector of strings",
"sets leak conductance for leakage")
#if defined(UG_FOR_LUA) && !defined(UG_FOR_VRL)
.add_method("set_cond", static_cast<void (T::*) (SmartPtr<LuaUserData<number, dim> >)>(&T::set_cond),
"", "leak conductance function (S/m^2)", "sets coordinate-dependent leak conductance value")
.add_method("set_cond", static_cast<void (T::*) (const char*)>(&T::set_cond),
"", "Lua name of leak conductance function (S/m^2)",
"sets coordinate-dependent leak conductance value")
#endif
.add_method("set_rev_pot", static_cast<void (T::*)(number)>(&T::set_rev_pot), "",
"leakage equilibrium potential (V) | default | value=-0.065",
"sets leakage equilibrium potential")
.add_method("set_rev_pot", static_cast<void (T::*)(number, const char*)>(&T::set_rev_pot),
"", "leakage equilibrium potential (V) | default | value=-0.065 # subset(s) as C-type string",
"sets leakage equilibrium potential")
.add_method("set_rev_pot", static_cast<void (T::*)(number, const std::vector<std::string>&)>(&T::set_rev_pot),
"", "leakage equilibrium potential (V) | default | value=-0.065 # subset(s) as vector of strings",
"sets leakage equilibrium potential")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "ChannelLeak", tag);
}
// ion leakage
{
typedef IonLeakage<TDomain> T;
typedef ICableMembraneTransport<TDomain> TBase;
string name = string("IonLeakage").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s)#Subset(s)")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s)#Subset(s)")
.add_method("set_perm", static_cast<void (T::*)(number)>(&T::set_perm),
"", "permeability", "sets a constant permeability")
.add_method("set_perm", static_cast<void (T::*)(number, number, number, number, int)>(&T::set_perm),
"", "flux at rest (mol/(m^2*s))#inner concentration at rest (mM)# outer concentration at rest (mM)#potential at rest (V)",
"tunes the channel to equilibrate fluxes at resting conditions")
.add_method("set_valency", &T::set_valency, "", "ion valency", "")
.add_method("set_ohmic", &T::set_ohmic, "", "ohmic?", "whether an Ohmic model is to be used")
.add_method("set_cond", &T::set_cond, "", "conductance", "set the conductance")
.add_method("set_rev_pot", &T::set_rev_pot, "", "reversal potential", "set the reversal potential")
.add_method("set_leaking_quantity", &T::set_leaking_quantity, "", "", "")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "IonLeakage", tag);
}
// VDCC BG
{
typedef VDCC_BG_cable<TDomain> T;
typedef ICableMembraneTransport<TDomain> TBase;
string name = string("VDCC_BG_cable").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s)#Subset(s)")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s)#Subset(s)")
.add_method("set_log_mGate" , &T::set_log_mGate)
.add_method("set_log_hGate" , &T::set_log_hGate)
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "VDCC_BG_cable", tag);
}
// PMCA
{
typedef PMCA_cable<TDomain> T;
typedef ICableMembraneTransport<TDomain> TBase;
string name = string("PMCA_cable").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s)#Subset(s)")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s)#Subset(s)")
.add_method("set_max_flux", &T::set_max_flux, "", "max. flux density (mol/(m^2*s)) | default | value=8.5e-9", "sets maximal flux density")
.add_method("set_kd", &T::set_kd, "", "K_D value inner [Ca] (mM) | default | value=6.0e-5", "sets K_D value for inner [Ca]")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "PMCA_cable", tag);
}
// NCX
{
typedef NCX_cable<TDomain> T;
typedef ICableMembraneTransport<TDomain> TBase;
string name = string("NCX_cable").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s)#Subset(s)")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s)#Subset(s)")
.add_method("set_max_flux", &T::set_max_flux, "", "max. flux density (mol/(m^2*s)) | default | value=3.75e-8", "sets maximal flux density")
.add_method("set_kd", &T::set_kd, "", "K_D value inner [Ca] (mM) | default | value=1.8e-3", "sets K_D value for inner [Ca]")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "NCX_cable", tag);
}
// Na/K pump
{
typedef Na_K_Pump<TDomain> T;
typedef ICableMembraneTransport<TDomain> TBase;
string name = string("Na_K_Pump").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s)#Subset(s)")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s)#Subset(s)")
.add_method("set_max_flux", &T::set_max_flux, "", "max. flux density (mol/(m^2*s)) | default | value=3.6e-2", "sets maximal flux density")
.add_method("set_K_K", &T::set_K_K, "", "K_D value outer [K] (mM) | default | value=1.37", "sets K_D value for outer [K]")
.add_method("set_K_Na", &T::set_K_Na, "", "K_D value inner [Na] (mM) | default | value=5.74", "sets K_D value for inner [Na]")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "Na_K_Pump", tag);
}
// K-channel (A-type) Golding 2001
{
typedef KA_Golding01<TDomain> T;
typedef ICableMembraneTransport<TDomain> TBase;
string name = string("KA_Golding01").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s)#Subset(s)")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s)#Subset(s)")
.add_method("set_conductance", static_cast<void (T::*) (number)>(&T::set_gkbar),
"", "K conductance (S/m^2)", "")
#if defined(UG_FOR_LUA) && !defined(UG_FOR_VRL)
.add_method("set_conductance", static_cast<void (T::*) (SmartPtr<LuaUserData<number, dim> >)>(&T::set_gkbar),
"", "K conductance function (S/m^2)", "sets coordinate-dependent K conductance value")
.add_method("set_conductance", static_cast<void (T::*) (const char*)>(&T::set_gkbar),
"", "Lua name of K conductance function (S/m^2)",
"sets coordinate-dependent K conductance value")
#endif
.add_method("set_vhalfn", &T::set_vhalfn)
.add_method("set_a0n", &T::set_a0n)
.add_method("set_zetan", &T::set_zetan)
.add_method("set_gmn", &T::set_gmn)
.add_method("set_vhalfn_dist", &T::set_vhalfn_dist)
.add_method("set_a0n_dist", &T::set_a0n_dist)
.add_method("set_zetan_dist", &T::set_zetan_dist)
.add_method("set_gmn_dist", &T::set_gmn_dist)
#if defined(UG_FOR_LUA) && !defined(UG_FOR_VRL)
// investigate: very strangely, it is not possible to register the following two methods in reverse order...:
// this gives: Registry ERROR: Unregistered Class used in Method:
// 'void KA_Golding011d:set_proximality_fct(SmartPtr<> set proximality function)': for Parameter 1
.add_method("set_proximality_fct", static_cast<void (T::*) (const char*)>(&T::set_proximality_fct),
"", "proximality function name",
"The proximality function returns 1 if a position is to be considered proximal "
"and 0 if it is to be considered distal.")
.add_method("set_proximality_fct", static_cast<void (T::*) (SmartPtr<LuaUserData<number, dim> >)>(&T::set_proximality_fct),
"", "proximality function",
"The proximality function returns 1 if a position is to be considered proximal "
"and 0 if it is to be considered distal.")
#endif
.add_method("set_logNGate", &T::set_logNGate)
.add_method("set_logLGate", &T::set_logLGate)
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "KA_Golding01", tag);
}
// K-channel (delayed rectifier) Golding 2001
{
typedef KDR_Golding01<TDomain> T;
typedef ICableMembraneTransport<TDomain> TBase;
string name = string("KDR_Golding01").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s)#Subset(s)")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s)#Subset(s)")
.add_method("set_conductance", static_cast<void (T::*) (number)>(&T::set_gkbar), "",
"K conductance (S/m^2) | default | value=30.0#"
"subset(s) as vector of string", "sets K conductance value")
#if defined(UG_FOR_LUA) && !defined(UG_FOR_VRL)
.add_method("set_conductance", static_cast<void (T::*) (SmartPtr<LuaUserData<number, dim> >)>(&T::set_gkbar),
"", "K conductance function (S/m^2)", "sets coordinate-dependent K conductance value")
.add_method("set_conductance", static_cast<void (T::*) (const char*)>(&T::set_gkbar),
"", "Lua name of K conductance function (S/m^2)",
"sets coordinate-dependent K conductance value")
#endif
.add_method("set_logNGate", &T::set_logNGate)
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "KDR_Golding01", tag);
}
// Na-channel (axon) Golding 2001
{
typedef Nax_Golding01<TDomain> T;
typedef ICableMembraneTransport<TDomain> TBase;
string name = string("Nax_Golding01").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s)#Subset(s)")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s)#Subset(s)")
.add_method("set_conductance", static_cast<void (T::*) (number)>(&T::set_gbar), "",
"Na conductance (S/m^2) | default | value=100.0#"
"subset(s) as vector of string", "sets Na conductance value")
#if defined(UG_FOR_LUA) && !defined(UG_FOR_VRL)
.add_method("set_conductance", static_cast<void (T::*) (SmartPtr<LuaUserData<number, dim> >)>(&T::set_gbar),
"", "Na conductance function (S/m^2)", "sets coordinate-dependent Na conductance value")
.add_method("set_conductance", static_cast<void (T::*) (const char*)>(&T::set_gbar),
"", "Lua name of Na conductance function (S/m^2)",
"sets coordinate-dependent Na conductance value")
#endif
.add_method("set_logMGate", &T::set_logMGate)
.add_method("set_logHGate", &T::set_logHGate)
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "Nax_Golding01", tag);
}
// CableEquation discretization class
{
typedef CableEquation<TDomain> T;
typedef IElemDisc<TDomain> TBase;
string name = string("CableEquation").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*)>
("Subset(s)")
.template add_constructor<void (*)(const char*, bool)>
("Subset(s)#with ion concentrations?")
.template add_constructor<void (*)(const char*, bool, number)>
("Subset(s)#with ion concentrations?#InitTime")
.add_method("set_diameter", static_cast<void (T::*)(number)>(&T::set_diameter),
"", "diameter (m) | default | value=1e-6", "sets a new diameter")
.add_method("set_spec_res", static_cast<void (T::*)(number)>(&T::set_spec_res),
"", "specific resistance (Ohm m) | default | value=1.0", "sets a new specific resistance")
.add_method("set_spec_cap", static_cast<void (T::*)(number)>(&T::set_spec_cap),
"", "specific capacitance (F/m^2) | default | value=1e-2", "sets a new specific capacitance")
#if defined(UG_FOR_LUA) && !defined(UG_FOR_VRL)
.add_method("set_spec_cap", static_cast<void (T::*)(SmartPtr<LuaUserData<number, TDomain::dim> >)>(&T::set_spec_cap),
"", "specific capacitance function (F/m^2)",
"sets a new specific capacitance on subsets given as C-style string")
.add_method("set_spec_cap", static_cast<void (T::*)(const char*)>(&T::set_spec_cap),
"", "specific capacitance function name (F/m^2)",
"sets a new specific capacitance on subsets given as vector of string")
#endif
.add_method("set_k_out", static_cast<void (T::*)(number)>(&T::set_k_out),
"", "extracellular [K] (mM) | default | value=4.0", "sets extracellular [K]")
.add_method("set_na_out", static_cast<void (T::*)(number)>(&T::set_na_out),
"", "extracellular [Na] (mM) | default | value=150.0", "sets extracellular [Na]")
.add_method("set_ca_out", static_cast<void (T::*)(number)>(&T::set_ca_out),
"", "extracellular [Ca] (mM) | default | value=1.5", "sets extracellular [Ca]")
.add_method("set_rev_pot_na", static_cast<void (T::*)(number)>(&T::set_rev_pot_na),
"", "Na reversal potential (V) | default | value=0.06", "sets reversal potential for Na")
.add_method("set_rev_pot_k", static_cast<void (T::*)(number)>(&T::set_rev_pot_k),
"", "K reversal potential (V) | default | value=-0.09", "sets reversal potential for K")
.add_method("set_rev_pot_ca", static_cast<void (T::*)(number)>(&T::set_rev_pot_ca),
"", "Ca reversal potential (V) | default | value=0.14", "sets reversal potential for Ca")
.add_method("set_temperature", static_cast<void (T::*)(number)>(&T::set_temperature),
"", "temperature (K) | default | value=310", "sets new temperature")
.add_method("set_temperature_celsius", static_cast<void (T::*)(number)>(&T::set_temperature_celsius),
"", "temperature (degrees C) | default | value=37", "sets new temperature")
.add_method("set_diff_coeffs", static_cast<void (T::*)(const std::vector<number>&)> (&T::set_diff_coeffs), "",
"diffusion coefficients of K, Na and Ca (m^2/s)", "sets diffusion coefficients")
.add_method("add", &T::add)
.add_method("set_influx", static_cast<void (T::*)(number, number, number, number, number, number)>(&T::set_influx), "",
"current (A) | default | value=1e-9 #"
"x-coordinate of influx position (m) | default | 0.0 #"
"y-coordinate of influx position (m) | default | 0.0 #"
"z-coordinate of influx position (m) | default | 0.0 #"
"start time (s) | default | 0 #"
"duration (s) | default | 0 ",
"sets position, duration and current strength of an influx")
.add_method("write_states_for_position", &T::write_states_for_position)
.add_method("set_output_point_and_path", &T::set_output_point_and_path)
#if defined(UG_FOR_LUA) && !defined(UG_FOR_VRL)
.add_method("set_influx_function",
static_cast<void (T::*)(const char*, const char*)> (&T::set_influx_function),
"", "lua function name # subset name", "Set an influx density function on a subset.")
.add_method("set_influx_function",
static_cast<void (T::*)(SmartPtr<LuaUserData<number, dim> >, const std::string&)> (&T::set_influx_function),
"", "LuaUserFunction # subset name", "Set an influx density function on a subset.")
#endif
.add_method("set_influx_subset", &T::set_influx_subset)
#ifdef UG_CPU_1
.add_method("estimate_cfl_cond", &T::template estimate_cfl_cond<CPUAlgebra::vector_type>)
#endif
.add_method("set_synapse_handler", &T::set_synapse_handler)
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "CableEquation", tag);
}
// CableEquationWithOuterPot
{
typedef CableEquationWithOuterPot<TDomain> T;
typedef CableEquation<TDomain> TBase;
string name = string("CableEquationWithOuterPot").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, const char*)>
("Fcts (inner potential, outer potential) # Subset(s)")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "CableEquationWithOuterPot", tag);
}
// Cuthill-McKee ordering
{
reg.add_function("order_cuthillmckee", &order_cuthillmckee<TDomain>, grp.c_str(),
"", "approxSpace", "vertex ordering for solver optimization");
}
// domain scaling
{
reg.add_function("scale_domain", &scale_domain<TDomain>, grp.c_str(),
"", "domain, scaling factor", "scales the domain (also diameter)");
}
// checks for acyclicity, presynaptic indices, both
{
reg.add_function("is_acyclic", static_cast<bool (*) (SmartPtr<TDomain>)>(&is_acyclic<TDomain>), grp.c_str(),
"", "domain", "Checks whether given domain is acyclic.");
reg.add_function("is_acyclic", static_cast<bool (*) (SmartPtr<TDomain>, int)>(&is_acyclic<TDomain>), grp.c_str(),
"", "domain, verbosity", "Checks whether given domain is acyclic.");
reg.add_function("check_presyn_indices", static_cast<int (*) (SmartPtr<TDomain>)>(&check_presyn_indices<TDomain>), grp.c_str(),
"", "domain", "Checks whether presynaptic indices are in order.");
reg.add_function("check_presyn_indices", static_cast<int (*) (SmartPtr<TDomain>, int)>(&check_presyn_indices<TDomain>), grp.c_str(),
"", "domain, verbosity", "Checks whether presynaptic indices are in order.");
reg.add_function("check_domain", static_cast<int (*) (SmartPtr<TDomain>)>(&check_domain<TDomain>), grp.c_str(),
"", "domain", "Checks whether given domain is sound.");
reg.add_function("check_domain", static_cast<int (*) (SmartPtr<TDomain>, int)>(&check_domain<TDomain>), grp.c_str(),
"", "domain, verbosity", "Checks whether given domain is sound.");
//reg.add_function("test_vertices", &test_vertices<TDomain>, grp.c_str(),
// "", "domain", "Tests the distributed vertices for correctness of the virtual table pointer.");
}
{
typedef SynapseHandler<TDomain> TSH;
string name = string("SynapseHandler").append(suffix);
reg.add_class_<TSH>(name, grp)
.template add_constructor<void (*)()>()
.add_method("set_ce_object", &TSH::set_ce_object)
.add_method("set_activation_timing_alpha",
static_cast<void (TSH::*)(number, number, number, number)>(&TSH::set_activation_timing_alpha),
"", "mean onset#mean tau#onset deviation#tau deviation", "")
.add_method("set_activation_timing_alpha",
static_cast<void (TSH::*)(number, number, number, number, number)>(&TSH::set_activation_timing_alpha),
"", "mean onset#mean tau#onset deviation#tau deviation#peak conductance", "")
.add_method("set_activation_timing_alpha",
static_cast<void (TSH::*)(number, number, number, number, number, bool)>(&TSH::set_activation_timing_alpha),
"", "mean onset#mean tau#onset deviation#tau deviation#peak conductance#constant seed?", "")
.add_method("set_activation_timing_alpha",
static_cast<void (TSH::*)(number, number, number, number, number, number, bool)>(&TSH::set_activation_timing_alpha),
"", "mean onset#mean tau#mean peak conductance#onset deviation#tau deviation#peak conductance deviation#constant seed?", "")
.add_method("set_activation_timing_biexp",
static_cast<void (TSH::*)(number, number, number, number, number, number)>(&TSH::set_activation_timing_biexp),
"", "mean onset#mean tau1#mean tau2#onset deviation#tau1 deviation#tau2 deviation", "")
.add_method("set_activation_timing_biexp",
static_cast<void (TSH::*)(number, number, number, number, number, number, number)>(&TSH::set_activation_timing_biexp),
"", "mean onset#mean tau1#mean tau2#onset deviation#tau1 deviation#tau2 deviation#peak conductance", "")
.add_method("set_activation_timing_biexp",
static_cast<void (TSH::*)(number, number, number, number, number, number, number, bool)>(&TSH::set_activation_timing_biexp),
"", "mean onset#mean tau1#mean tau2#onset deviation#tau1 deviation#tau2 deviation#peak conductance#constant seed?", "")
.add_method("set_activation_timing_biexp",
static_cast<void (TSH::*)(number, number, number, number, number, number, number, number, bool)>(&TSH::set_activation_timing_biexp),
"", "mean onset#mean tau1#mean tau2#mean peak conductance#onset deviation#tau1 deviation#tau2 deviation#peak conductance deviation#constant seed?", "")
.add_method("add_activation_timing_alpha_ball", &TSH::add_activation_timing_alpha_ball,
"", "timing values as six-component vector (mean onset, dev onset, mean tau, dev tau, mean peak conductance, dev peak conductance)"
"#ball region as four component vector (center coordinates, radius)",
"Add a ball-shaped region with specific activation pattern for alpha post-synapses.")
.add_method("add_activation_timing_exp2_ball", &TSH::add_activation_timing_exp2_ball,
"", "timing values as six-component vector (mean onset, mean tau1, mean tau2, mean peak conductance, onset dev, tau1 dev, tau2 dev, dev peak conductance)"
"#ball region as four component vector (center coordinates, radius)",
"Add a ball-shaped region with specific activation pattern for exp2 post-synapses.")
.add_method("show_status", &TSH::show_status)
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "SynapseHandler", tag);
}
// ////////////////////////////////////////////
// //////// SynapseDistributor ////////////////
// ////////////////////////////////////////////
{
const string name = "SynapseDistributor";
const string dimName = name + suffix;
string constr_params("infile#outfile");
typedef SynapseDistributor TSD;
reg.add_class_<TSD>(dimName, grp)
.add_constructor<void (*)(string)>("infile")
.add_constructor<void (*)(SmartPtr<TDomain>)>("dom")
.add_method("clear", static_cast<void (TSD::*)()>(&TSD::clear), "", "",
"Removes all synapses from grid.")
.add_method("clear", static_cast<void (TSD::*)(int)>(&TSD::clear), "", "subsetIndex",
"Removes all Synapses from subset.")
.add_method("place_synapse_at_coords", &TSD::place_synapse_at_coords, "",
"coordinates (as three-component vector)#pre-synapse#post-synapse",
"Places one pair of pre- and post-synapse on the edge nearest to the given coordinates.")
.add_method("place_synapses_uniform",
static_cast<void (TSD::*)(size_t, const string&)>(&TSD::place_synapses_uniform),
"", "number of synapses#synapse type", "Distributes post-synapses uniformly on grid.")
.add_method("place_synapses_uniform",
static_cast<void (TSD::*)(int, size_t, const string&)>(&TSD::place_synapses_uniform),
"", "subset index#number of synapses#synapse type", "Distributes post-synapses uniformly on subset.")
.add_method("place_synapses_uniform",
static_cast<void (TSD::*)(const char*, size_t, const string&)>(&TSD::place_synapses_uniform),
"", "subset name#number of synapses#synapse type", "Distributes post-synapses uniformly on subset.")
.add_method("place_synapses_uniform_density",
static_cast<void (TSD::*)(int, number, const string&)>(&TSD::place_synapses_uniform),
"", "subset index#density (m^-1)#synapse type", "Uniformly distributes post-synapses on subset with given density.")
.add_method("place_synapses_uniform",
static_cast<void (TSD::*)(const char*, number, const string&)>(&TSD::place_synapses_uniform),
"", "subset name#density (m^-1)#synapse type", "Uniformly distributes post-synapses on subset with given density.")
.add_method("place_synapses_uniform_density",
static_cast<void (TSD::*)(number, number, number, number, number, const string&)>(&TSD::place_synapses_uniform),
"", "subset name#density (m^-1)#synapse type", "Uniformly distributes post-synapses in ball region.")
.add_method("place_synapses_uniform",
static_cast<void (TSD::*)(size_t, number, number, number, number, const string&)>(&TSD::place_synapses_uniform),
"", "number of synapses#x#y#z#radius#type of synapse")
.add_method("place_synapses", &TSD::place_synapses,
"", "", "Distributes post-synapses according to given distribution on the subsets.")
.add_method("degenerate_uniform", static_cast<void (TSD::*)(number)>(&TSD::degenerate_uniform),
"", "percentage", "Removes a percentage of synapses from the grid.")
.add_method("degenerate_uniform", static_cast<void (TSD::*)(number, int)>(&TSD::degenerate_uniform),
"", "percentage#subset index", "Removes a percentage of synapses from the given subset.")
.add_method("degenerate_uniform", static_cast<void (TSD::*)(number, const char*)>(&TSD::degenerate_uniform),
"", "percentage#subset name", "Removes a percentage of synapses from the given subset.",grp)
.add_method("num_synapses", static_cast<size_t (TSD::*)() const>(&TSD::num_synapses),
"", "", "Returns global number of synapses.")
.add_method("num_synapses", static_cast<size_t (TSD::*)(int) const>(&TSD::num_synapses),
"", "subset index", "Returns number of synapses in specified subset.")
.add_method("num_synapses", static_cast<size_t (TSD::*)(const char*) const>(&TSD::num_synapses),
"", "subset name", "Returns number of synapses in specified subset.")
.add_method("print_status", &TSD::print_status, "", "", "Prints synapse status of grid.")
.add_method("export_grid", &TSD::export_grid, "", "file name", "Saves grid with synapses to file.")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(dimName, name, tag);
}
}
/**
* Function called for the registration of Domain and Algebra dependent parts.
* All Functions and Classes depending on both Domain and Algebra
* are to be placed here when registering. The method is called for all
* available Domain and Algebra types, based on the current build options.
*
* @param reg registry
* @param grp group for sorting of functionality
*/
template <typename TDomain, typename TAlgebra>
static void DomainAlgebra(bridge::Registry& reg, string grp)
{
string suffix = GetDomainAlgebraSuffix<TDomain, TAlgebra>();
string tag = GetDomainAlgebraTag<TDomain, TAlgebra>();
// CableAssTuner
{
typedef CableAssTuner<TDomain, TAlgebra> T;
string name = string("CableAssTuner");
reg.add_class_<T>(name+suffix, grp)
.template add_constructor<void (*)(SmartPtr<DomainDiscretization<TDomain, TAlgebra> >,
SmartPtr<ApproximationSpace<TDomain> >)>("domain disc")
.add_method("remove_ghosts_from_assembling_iterator", &T::template remove_ghosts_from_assembling_iterator<1>)
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name+suffix, name, tag);
}
}
/**
* Function called for the registration of Dimension dependent parts.
* All Functions and Classes depending on the Dimension
* are to be placed here when registering. The method is called for all
* available Dimension types, based on the current build options.
*
* @param reg registry
* @param grp group for sorting of functionality
*/
template <int dim>
static void Dimension(Registry& reg, string grp)
{
string suffix = GetDimensionSuffix<dim>();
string tag = GetDimensionTag<dim>();
}
/**
* Function called for the registration of Algebra dependent parts.
* All Functions and Classes depending on Algebra
* are to be placed here when registering. The method is called for all
* available Algebra types, based on the current build options.
*
* @param reg registry
* @param grp group for sorting of functionality
*/
template <typename TAlgebra>
static void Algebra(Registry& reg, string grp)
{
string suffix = GetAlgebraSuffix<TAlgebra>();
string tag = GetAlgebraTag<TAlgebra>();
}
/**
* Function called for the registration of Domain and Algebra independent parts.
* All Functions and Classes not depending on Domain and Algebra
* are to be placed here when registering.
*
* @param reg registry
* @param grp group for sorting of functionality
*/
static void Common(Registry& reg, string grp)
{
{
typedef synapse_handler::IBaseSynapse TBS;
reg.add_class_<TBS>("IBaseSynapse", grp)
;
}
{
typedef synapse_handler::IPreSynapse T;
typedef synapse_handler::IBaseSynapse TBase;
reg.add_class_<T, TBase>("IPreSynapse", grp);
}
{
typedef synapse_handler::IPostSynapse T;
typedef synapse_handler::IBaseSynapse TBase;
reg.add_class_<T, TBase>("IPostSynapse", grp);
}
{
string name = "ISynapseContainer";
typedef ISynapseContainer TSC;
reg.add_class_<TSC>(name, grp);;
}
{
string name = "AlphaSynapses";
typedef AlphaSynapses TSC;
reg.add_class_<TSC>(name, grp)
.add_constructor<void (*)(const size_t, const size_t)>("infile#outfile", "Initializes a SynapseDistributor", grp, "")
//.add_constructor<void (*)(const size_t, number, number, number, number, number, number, number)>("dom#outfile", "Initializes a SynapseDistributor", grp, "")
.add_method("set_mean_gMax",&TSC::set_mean_gMax)
.add_method("set_dev_gMax",&TSC::set_dev_gMax)
.add_method("set_mean_onset",&TSC::set_mean_onset)
.add_method("set_dev_onset",&TSC::set_dev_onset)
.add_method("set_mean_tau",&TSC::set_mean_tau)
.add_method("set_dev_tau",&TSC::set_dev_tau)
.add_method("set_mean_e",&TSC::set_mean_rev)
.add_method("set_dev_e",&TSC::set_dev_rev)
.add_method("size",&TSC::size)
.add_method("get_synapses",&TSC::get_synapses);
}
{
string name = "Exp2Synapses";
typedef Exp2Synapses TSC;
reg.add_class_<TSC>(name, grp)
.add_constructor<void (*)(const size_t, const size_t)>("infile#outfile", "Initializes a SynapseDistributor", grp, "")
//.add_constructor<void (*)(const size_t, number, number, number, number, number, number, number)>("dom#outfile", "Initializes a SynapseDistributor", grp, "")
.add_method("set_mean_onset",&TSC::set_mean_onset)
.add_method("set_dev_onset",&TSC::set_dev_onset)
.add_method("set_mean_tau1",&TSC::set_mean_tau1)
.add_method("set_dev_tau1",&TSC::set_dev_tau1)
.add_method("set_mean_tau2",&TSC::set_mean_tau2)
.add_method("set_dev_tau2",&TSC::set_dev_tau2)
.add_method("set_mean_e",&TSC::set_mean_rev)
.add_method("set_dev_e",&TSC::set_dev_rev)
.add_method("set_mean_w",&TSC::set_mean_gMax)
.add_method("set_dev_w",&TSC::set_dev_gMax)
.add_method("size",&TSC::size)
.add_method("get_synapses",&TSC::get_synapses);
}
{
string name = "AlphaSynapsePair";
typedef AlphaSynapsePair T;
reg.add_class_<T>(name, grp)
.add_constructor()
.add_method("set_id",&T::set_id)
.add_method("set_onset",&T::set_onset)
.add_method("set_tau",&T::set_tau)
.add_method("set_gMax",&T::set_gMax)
.add_method("set_reversal_potential",&T::set_reversal_potential)
.add_method("pre_synapse",&T::pre_synapse)
.add_method("post_synapse",&T::post_synapse)
.set_construct_as_smart_pointer(true);
}
{
string name = "Exp2SynapsePair";
typedef Exp2SynapsePair T;
reg.add_class_<T>(name, grp)
.add_constructor()
.add_method("set_id",&T::set_id)
.add_method("set_threshold",&T::set_threshold)
.add_method("set_gMax",&T::set_gMax)
.add_method("set_reversal_potential",&T::set_reversal_potential)
.add_method("set_taus",&T::set_taus)
.add_method("pre_synapse",&T::pre_synapse)
.add_method("post_synapse",&T::post_synapse)
.set_construct_as_smart_pointer(true);
}
// ugx -> swc conversion
reg.add_function("save_neuron_to_swc", &save_neuron_to_swc, grp.c_str(),
"", "ugx file name # neuron index # swc file name # scale",
"Save a single neuron from a ugx neuronal network to swc.");
// innermost_neuron_id_in_subset
reg.add_function("innermost_neuron_id_in_subset", &innermost_neuron_id_in_subset, grp.c_str(),
"", "subset name # subset handler", "");
// neurite subset length
reg.add_function("subset_length", static_cast<number (*) (int, ConstSmartPtr<MGSubsetHandler>)>(&subset_length),
grp.c_str(), "length of neurite subset",
"subset index#subset handler", "Get the total length of all neurite segments in subset.");
reg.add_function("subset_length", static_cast<number (*) (const char*, ConstSmartPtr<MGSubsetHandler>)>(&subset_length),
grp.c_str(), "length of neurite subset",
"subset index#subset handler", "Get the total length of all neurite segments in subset.");
#ifdef UG_PARALLEL
#ifdef UG_DIM_3
{
typedef DomainPartitioner<Domain3d, SimpleCableNeuronPartitioner> T;
string name = "SimpleCableNeuronPartitioner";
reg.add_class_<T, IPartitioner>(name, grp)
.add_constructor<void (*)(Domain3d&)>("domain")
.set_construct_as_smart_pointer(true);
}
#endif
#endif
#ifdef NC_WITH_PARMETIS
{
typedef CableNeuronUnificator T;
std::string name = std::string("CableNeuronUnificator");
typedef parmetis::IUnificator<Edge> TBase;
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)()>()
.set_construct_as_smart_pointer(true);
}
#endif
// NeuronalTopologyImporter
{
typedef neuronal_topology_importer::NeuronalTopologyImporter T;
std::string name = std::string("NeuronalTopologyImporter");
reg.add_class_<T>(name, grp)
.add_constructor<void (*) ()>("", "", grp)
.add_method("set_scaling_factors", &T::set_scaling_factors, "", "length # time # potential # conductance", "")
.add_method("set_length_scaling", &T::set_length_scaling, "", "length scaling factor", "")
.add_method("set_time_scaling", &T::set_time_scaling, "", "time scaling factor", "")
.add_method("set_potential_scaling", &T::set_potential_scaling, "", "potential scaling factor", "")
.add_method("set_conductance_scaling", &T::set_conductance_scaling, "", "conductance scaling factor", "")
.add_method("add_joining_criterion", &T::add_joining_criterion, "", "criterion", "")
.add_method("rm_joining_criterion", &T::rm_joining_criterion, "", "criterion", "")
.add_method("import_geometry_and_generate_grid",
(bool (T::*)(const std::string&)) (&T::import_and_generate_grid),
"success", "file name")
.add_method("import_geometry_and_generate_grid",
(bool (T::*)(const std::string&, const std::string&)) (&T::import_and_generate_grid),
"success", "file base name # format (hoc, ngx, swc, txt)")
.set_construct_as_smart_pointer(true);
}
reg.add_function("AddDiamAttachmentHandlerToGrid", &AddDiamAttachmentHandlerToGrid, grp.c_str(),
"", "grid", "When added, the DiamAttachmentHandler will propagate global diameter attachments "
"through newly created grid levels.");
}
}; // end Functionality
// end group plugin_cable_neuron
/// \}
} // end namespace cable_neuron
/// This function is called when the plugin is loaded.
extern "C" void
InitUGPlugin_cable_neuron(Registry* reg, string grp)
{
grp.append("/cable_neuron");
// declare global grid attachments for diameter, synapses and presynaptic indices
typedef ANumber ADiameter;
typedef Attachment<std::vector<IBaseSynapse*> >AVSynapse;
typedef Attachment<uint> ANeuronID;
GlobalAttachments::declare_attachment<ADiameter>("diameter", true);
GlobalAttachments::declare_attachment<AVSynapse>("synapses", false);
GlobalAttachments::declare_attachment<ANeuronID>("neuronID", false);
typedef cable_neuron::Functionality Functionality;
// we only need to compile for 3D, as cable models are always in a 3D space
typedef boost::mpl::list<
#ifdef UG_DIM_3
Domain3d
#endif
> OurCompileDomainList;
try