-
Notifications
You must be signed in to change notification settings - Fork 1
/
neuro_collection_plugin.cpp
1268 lines (1164 loc) · 61 KB
/
neuro_collection_plugin.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
*
* Author: Markus Breit
* Creation date: 2014-06-13
*
* 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.
*/
/**********************************************************************************
* NEURO collection
*
* This plugin aims at collecting and unifying any neuro-related functionality
* that is developed for UG4 and that the author thinks of as usable for others.
**********************************************************************************/
#include "bridge/util.h"
// replace this with util_domain_dependent.h or util_algebra_dependent.h
// to speed up compilation time
#include "bridge/util_domain_algebra_dependent.h"
#include "lib_grid/global_attachments.h" // for GlobalAttachments::declare_attachment
// configuration file for compile options
#include "nc_config.h"
#include "buffer_fv1.h"
#include "membrane_transport_fv1.h"
#include "user_flux_bnd_fv1.h"
#include "membrane_transporters/membrane_transporter_interface.h"
#include "membrane_transporters/hh.h"
#include "membrane_transporters/hh_charges.h"
#include "membrane_transporters/hh_species.h"
#include "membrane_transporters/leakage_ohmic.h"
#include "membrane_transporters/ip3r.h"
#include "membrane_transporters/ryr.h"
#include "membrane_transporters/ryr_discrete.h"
#include "membrane_transporters/ryr_implicit.h"
#include "membrane_transporters/ryr_linearized.h"
#include "membrane_transporters/serca.h"
#include "membrane_transporters/leak.h"
#include "membrane_transporters/pmca.h"
#include "membrane_transporters/ncx.h"
#include "membrane_transporters/ryr_instat.h"
#include "membrane_transporters/vdcc_bg/vdcc_bg.h"
#include "membrane_transporters/vdcc_bg/vdcc_bg_userdata.h"
#ifdef NC_WITH_CABLENEURON
//#include "hybrid_neuron_communicator.h"
#include "hybrid_synapse_current_assembler.h"
#include "membrane_transporters/vdcc_bg/vdcc_bg_cableneuron.h"
#include "membrane_transport_1d.h"
#endif
#ifdef NC_WITH_MPM
#include "membrane_transporters/vdcc_bg/vdcc_bg_vm2ug.h"
#ifdef NC_WITH_NEURON
#include "membrane_transporters/vdcc_bg/vdcc_bg_neuron.h"
#endif
#endif
#include "membrane_transporters/mcu.h"
#include "membrane_transporters/mncx.h"
#include "membrane_transporters/nmdar.h"
#include "stimulation/action_potential_train.h"
#include "grid_generation/bouton_generator.h"
#include "grid_generation/dendrite_generator.h"
#include "grid_generation/spine_generation.h"
#include "grid_generation/neurites_from_swc.h"
#include "grid_generation/polygonal_mesh_from_txt.h"
#include "lib_grid/refinement/projectors/neurite_projector.h"
#include "test/test_neurite_proj.h"
#include "util/measurement.h"
#include "util/ca_wave_util.h"
#include "util/axon_util.h"
#include "util/hh_util.h"
#include "util/misc_util.h"
#include "util/neurite_axial_refinement_marker.h"
#include "util/solution_impexp_util.h"
#include "lib_disc/function_spaces/grid_function.h"
#include "lib_disc/spatial_disc/elem_disc/inner_boundary/inner_boundary_impl.h"
#include "test/neurite_math_util.h"
using namespace std;
using namespace ug::bridge;
namespace ug{
namespace neuro_collection{
/**
* \defgroup plugin_neuro_collection Plugin neuro_collection
* \ingroup plugins_experimental
* This plugin aims to collect and unify any neuro-related functionality that is
* developed for ug4 and that the author thinks of as usable for others.
* \{
*/
/**
* 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 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(Registry& reg, string grp)
{
string suffix = GetDomainAlgebraSuffix<TDomain,TAlgebra>();
string tag = GetDomainAlgebraTag<TDomain,TAlgebra>();
typedef GridFunction<TDomain, TAlgebra> TGridFunction;
// extra commands for this plugin
reg.add_function("take_measurement", static_cast<number (*)(SmartPtr<TGridFunction>, const number, const char*, const char*, const char*)>(&takeMeasurement<GridFunction<TDomain, TAlgebra> >), grp.c_str(),
"", "solution#time#subset names#function names#output file name",
"outputs average values of unknowns on subsets");
// calcium wave examination functions
reg.add_function("max_ryr_flux_density", &maxRyRFluxDensity<TGridFunction, RyRImplicit<TDomain> >, grp.c_str(),
"", "solution # function names for ca_cyt, ca_er, c1, c2 as c-style string #"
"RyR-carrying membrane subset names as c-style string # RyR channel",
"maximal flux density through RyR channel (mol/(m^2*s))");
reg.add_function("max_ryr_flux_density", &maxRyRFluxDensity<TGridFunction, RyRLinearized<TDomain> >, grp.c_str(),
"", "solution # function names for ca_cyt, ca_er, c1, c2 as c-style string #"
"RyR-carrying membrane subset names as c-style string # RyR channel",
"maximal flux density through RyR channel (mol/(m^2*s))");
reg.add_function("wave_front_x", &waveFrontX<TGridFunction>, grp.c_str(),
"", "solution # function names for c1, c2 as c-style string #"
"RyR-carrying membrane subset names as c-style string # threshold open probability",
"rightmost vertex where threshold value is exceeded");
// WaveProfileExporter
{
typedef WaveProfileExporter<TDomain, TAlgebra> T;
string name = string("WaveProfileExporter").append(suffix);
reg.add_class_<T>(name, grp)
.template add_constructor<void (*)(SmartPtr<ApproximationSpace<TDomain> >,
const char*, const char*, const std::string&)>
("approximation space # function names (comma-separated c-string) # "
"subset names (comma-separated c-string) # file base name")
.add_method("exportWaveProfileX", &T::exportWaveProfileX, "", "", "")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "WaveProfileExporter", tag);
}
// measurements
reg.add_function("take_measurement", static_cast<number (*)(SmartPtr<TGridFunction>, const number, const char*, const char*, const char*, const char*)>(&takeMeasurement<GridFunction<TDomain, TAlgebra> >), grp.c_str(),
"", "solution#time#subset names#function names#output file name#output file extension",
"outputs average values of unknowns on subsets");
// solution import / export
reg.add_function("exportSolution", &exportSolution<TGridFunction>, grp.c_str(),
"", "solution#time#subsetNames#functionNames#outFileName", "outputs solutions to file");
reg.add_function("importSolution", &importSolution<TGridFunction>, grp.c_str(),
"", "solution#subset names#function name#input file name",
"writes values for the given function and on the given subsets "
"from the given file to the given solution vector "
"(using the value of the nearest neighbor for each vertex)");
// export all template realizations of RyRImplicit::calculate_steady_state()
{
typedef RyRImplicit<TDomain> T;
ClassGroupDesc* cgd = reg.get_class_group(std::string("RyRImplicit"));
size_t numClasses = cgd->num_classes();
size_t i = 0;
for (; i < numClasses; ++i)
{
std::string classTag = cgd->get_class_tag(i);
if (classTag == GetDomainTag<TDomain>())
{
ExportedClass<T>* expClass = dynamic_cast<ExportedClass<T>* >(cgd->get_class(i));
UG_COND_THROW(!expClass, "Exported class can not be cast to the correct type.");
expClass->add_method("calculate_steady_state",
&T::template calculate_steady_state<TGridFunction>, "", "", "");
break;
}
}
UG_COND_THROW(i == numClasses, "No class with domain tag '" << GetDomainTag<TDomain>()
<< "' found in RyRImplicit class group to add algebra-dependent functionality to.");
// same again for 1d special case
typedef RyRImplicit_1drotsym<TDomain> T1;
cgd = reg.get_class_group(std::string("RyRImplicit_1drotsym"));
numClasses = cgd->num_classes();
i = 0;
for (; i < numClasses; ++i)
{
std::string classTag = cgd->get_class_tag(i);
if (classTag == GetDomainTag<TDomain>())
{
ExportedClass<T1>* expClass = dynamic_cast<ExportedClass<T1>* >(cgd->get_class(i));
UG_COND_THROW(!expClass, "Exported class can not be cast to the correct type.");
expClass->add_method("calculate_steady_state",
&T1::template calculate_steady_state<TGridFunction>, "", "", "");
break;
}
}
UG_COND_THROW(i == numClasses, "No class with domain tag '" << GetDomainTag<TDomain>()
<< "' found in RyRImplicit_1drotsym class group to add algebra-dependent functionality to.");
typedef RyRLinearized<TDomain> T2;
cgd = reg.get_class_group(std::string("RyRLinearized"));
numClasses = cgd->num_classes();
i = 0;
for (; i < numClasses; ++i)
{
std::string classTag = cgd->get_class_tag(i);
if (classTag == GetDomainTag<TDomain>())
{
ExportedClass<T2>* expClass = dynamic_cast<ExportedClass<T2>* >(cgd->get_class(i));
UG_COND_THROW(!expClass, "Exported class can not be cast to the correct type.");
expClass->add_method("calculate_steady_state",
&T2::template calculate_steady_state<TGridFunction>, "", "", "");
break;
}
}
UG_COND_THROW(i == numClasses, "No class with domain tag '" << GetDomainTag<TDomain>()
<< "' found in RyRLinearized class group to add algebra-dependent functionality to.");
}
// export all template realizations of VDCC_BG::calculate_steady_state()
{
typedef VDCC_BG<TDomain> T;
ClassGroupDesc* cgd = reg.get_class_group(std::string("VDCC_BG"));
size_t numClasses = cgd->num_classes();
size_t i = 0;
for (; i < numClasses; ++i)
{
std::string classTag = cgd->get_class_tag(i);
if (classTag == GetDomainTag<TDomain>())
{
ExportedClass<T>* expClass = dynamic_cast<ExportedClass<T>* >(cgd->get_class(i));
UG_COND_THROW(!expClass, "Exported class can not be cast to the correct type.");
expClass->add_method("calculate_steady_state",
&T::template calculate_steady_state<TGridFunction>, "", "solution # equilibrium potential (V)", "");
break;
}
}
UG_COND_THROW(i == numClasses, "No class with domain tag '" << GetDomainTag<TDomain>()
<< "' found in VDCC_BG class group to add algebra-dependent functionality to.");
}
}
/**
* Function called for the registration of Domain dependent parts.
* 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 grp group for sorting of functionality
*/
template <typename TDomain>
static void Domain(Registry& reg, string grp)
{
const int dim = TDomain::dim;
string suffix = GetDomainSuffix<TDomain>();
string tag = GetDomainTag<TDomain>();
// implementation of buffering reaction disc
{
typedef BufferFV1<TDomain> T;
typedef IElemDisc<TDomain> TBase;
string name = string("BufferFV1").append(suffix);
reg.add_class_<T, TBase>(name, grp)
.template add_constructor<void (*)(const char*)>("Subset(s)")
.add_method("set_num_reactions", &T::set_num_reactions, "", "number of reactions | default | value=1",
"set number of reactions about to be added")
.add_method("add_reaction", static_cast<void (T::*)
(const char*, const char*, number, number, number)>(&T::add_reaction), "",
"buffering substance | selection | value=[\"clb\"] # "
"buffered substance | selection | value=[\"ca_cyt\"] # "
"total buffer | default | value=160.0e-6D # "
"association rate | default | value=27.0e06D # "
"dissociation rate | default | value=19.0D",
"add a new reaction definition")
#ifdef UG_FOR_LUA
.add_method("add_reaction", static_cast<void (T::*)
(const char*, const char*, number, const char*, const char*)>(&T::add_reaction), "",
"buffering substance | selection | value=[\"clb\"] # "
"buffered substance | selection | value=[\"ca_cyt\"] # "
"total buffer | default | value=160.0e-6D # "
"association rate | default | value=27.0e06D # "
"dissociation rate | default | value=19.0D",
"add a new reaction definition")
#endif
.add_method("add_reaction", static_cast<void (T::*)
(const char*, const char*, SmartPtr<CplUserData<number, dim> >,
SmartPtr<CplUserData<number, dim> >, SmartPtr<CplUserData<number, dim> >)>(&T::add_reaction), "",
"buffering substance | selection | value=[\"clb\"] # "
"buffered substance | selection | value=[\"ca_cyt\"] # "
"total buffer | default | value=160.0e-6D # "
"association rate | default | value=27.0e06D # "
"dissociation rate | default | value=19.0D",
"add a new reaction definition")
.add_method("set_linearized_assembling", &T::set_linearized_assembling)
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "BufferFV1", tag);
}
// implementation of two-sided membrane transport systems
{
typedef MembraneTransportFV1<TDomain> T;
typedef IElemDisc<TDomain> TBase;
string name = string("MembraneTransportFV1").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, SmartPtr<IMembraneTransporter>)>("Subset(s) as comma-separated c-string#MembraneTransporter")
.template add_constructor<void (*)(const std::vector<std::string>&, SmartPtr<IMembraneTransporter>)>("Subset(s) as vector#MembraneTransporter")
.add_method("set_density_function", static_cast<void (T::*) (const number)> (&T::set_density_function),
"", "", "add a constant density")
#ifdef UG_FOR_LUA
.add_method("set_density_function", static_cast<void (T::*) (const char*)> (&T::set_density_function),
"", "", "add a density function")
#endif
.add_method("set_density_function", static_cast<void (T::*) (SmartPtr<CplUserData<number,dim> >)>
(&T::set_density_function), "", "", "add a density function")
.add_method("set_flux_scale", static_cast<void (T::*)(number)>(&T::set_flux_scale),
"", "scale", "Set scale to scale (all) fluxes with.")
.add_method("set_flux_scale", static_cast<void (T::*)(SmartPtr<CplUserData<number, dim> >)>(&T::set_flux_scale),
"", "scale", "Set scale to scale (all) fluxes with.")
#ifdef UG_FOR_LUA
.add_method("set_flux_scale", static_cast<void (T::*)(const char*)>(&T::set_flux_scale),
"", "scale", "Set scale to scale (all) fluxes with.")
#endif
.add_method("set_membrane_transporter", &T::set_membrane_transporter, "", "", "sets the membrane transport mechanism")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "MembraneTransportFV1", tag);
}
#ifdef NC_WITH_CABLENEURON
// implementation of two-sided membrane transport systems (1d "cable", fcts const in radius and angle)
{
typedef MembraneTransport1d<TDomain> T;
typedef IElemDisc<TDomain> TBase;
string name = string("MembraneTransport1d").append(suffix);
reg.add_class_<T, TBase >(name, grp)
.template add_constructor<void (*)(const char*, SmartPtr<IMembraneTransporter>)>("Subset(s) as comma-separated c-string#MembraneTransporter")
.template add_constructor<void (*)(const std::vector<std::string>&, SmartPtr<IMembraneTransporter>)>("Subset(s) as vector#MembraneTransporter")
.add_method("set_density_function", static_cast<void (T::*) (const number)> (&T::set_density_function),
"", "", "add a constant density")
#ifdef UG_FOR_LUA
.add_method("set_density_function", static_cast<void (T::*) (const char*)> (&T::set_density_function),
"", "", "add a density function")
#endif
.add_method("set_density_function", static_cast<void (T::*) (SmartPtr<CplUserData<number,dim> >)>
(&T::set_density_function), "", "", "add a density function")
.add_method("set_radius", &T::set_radius, "", "", "sets the radius the membrane is located at")
.add_method("set_radius_factor", &T::set_radius_factor, "", "", "sets the radius the membrane is located at")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "MembraneTransport1d", tag);
}
#endif
// user flux boundary
{
typedef UserFluxBoundaryFV1<TDomain> T;
typedef IElemDisc<TDomain> TBase;
string name = string("UserFluxBoundaryFV1").append(suffix);
reg.add_class_<T, TBase>(name, grp)
.template add_constructor<void (*)(const char*, const char*)>("Function(s) as comma-separated c-string#Subset(s) as comma-separated c-string")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>("Function(s) as vector#Subset(s) as vector")
.add_method("set_flux_function", static_cast<void (T::*) (SmartPtr<CplUserData<number, dim> >)> (&T::set_flux_function),
"", "", "add a flux density function")
.add_method("set_flux_function", static_cast<void (T::*) (number)> (&T::set_flux_function),
"", "", "add a flux density function")
#ifdef UG_FOR_LUA
.add_method("set_flux_function", static_cast<void (T::*) (const char*)> (&T::set_flux_function),
"", "", "add a flux density function")
#endif
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "UserFluxBoundaryFV1", tag);
}
// Hodgkin-Huxley channels
{
typedef HH<TDomain> T;
typedef IMembraneTransporter TBase1;
typedef IElemDisc<TDomain> TBase2;
std::string name = std::string("HH").append(suffix);
reg.add_class_<T, TBase1, TBase2>(name, grp)
.template add_constructor<void (*)(const char*, const char*)>
("Functions as comma-separated string with the following order: "
"\"inner potential\", \"outer potential\", \"gating param n\", \"gating param m\", \"gating param h\" # "
"subsets as comma-separated string")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>
("Function vector with the following order: "
"\"inner potential\", \"outer potential\", \"gating param n\", \"gating param m\", \"gating param h\" # "
"subsets vector")
.add_method("set_conductances", &T::set_conductances, "", "g_K#g_Na", "")
.add_method("set_reversal_potentials", &T::set_reversal_potentials, "", "E_K#E_Na", "")
.add_method("set_reference_time", &T::set_reference_time, "", "reference time (in units of s)", "")
.add_method("use_exact_gating_mode", &T::use_exact_gating_mode, "", "time step size", "")
.add_method("use_gating_explicit_current_mode", &T::use_gating_explicit_current_mode, "", "time step size", "")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "HH", tag);
}
// Hodgkin-Huxley channels with charge densities as source / target
{
typedef HHCharges<TDomain> T;
typedef IMembraneTransporter TBase1;
typedef IElemDisc<TDomain> TBase2;
std::string name = std::string("HHCharges").append(suffix);
reg.add_class_<T, TBase1, TBase2>(name, grp)
.template add_constructor<void (*)(const char*, const char*)>
("Functions as comma-separated string with the following order: "
"\"inner charge density\", \"outer charge density\", \"inner potential\", \"outer potential\","
"\"gating param n\", \"gating param m\", \"gating param h\" # "
"subsets as comma-separated string")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>
("Function vector with the following order: "
"\"inner charge density\", \"outer charge density\", \"inner potential\", \"outer potential\","
"\"gating param n\", \"gating param m\", \"gating param h\" # "
"subsets vector")
.add_method("set_conductances", &T::set_conductances, "", "g_K#g_Na", "")
.add_method("set_reversal_potentials", &T::set_reversal_potentials, "", "E_K#E_Na", "")
.add_method("set_reference_time", &T::set_reference_time, "", "reference time (in units of s)", "")
.add_method("use_exact_gating_mode", &T::use_exact_gating_mode, "", "time step size", "")
.add_method("use_gating_explicit_current_mode", &T::use_gating_explicit_current_mode, "", "time step size", "")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "HHCharges", tag);
}
// Hodgkin-Huxley channels with Na and K unknowns
{
typedef HHSpecies<TDomain> T;
typedef IMembraneTransporter TBase;
std::string name = std::string("HHSpecies").append(suffix);
reg.add_class_<T, TBase>(name, grp)
.template add_constructor<void (*)(const char*, const char*, ConstSmartPtr<ISubsetHandler>)>
("Functions as comma-separated string with the following order: "
"\"inner [K+] \", \"outer [K+]\", \"inner [Na+] \", \"outer [Na+]\", "
"\"inner potential\", \"outer potential\" # "
"subsets as comma-separated string # SubsetHandler")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&, ConstSmartPtr<ISubsetHandler>)>
("Function vector with the following order: "
"\"inner charge density\", \"outer charge density\", \"inner potential\", \"outer potential\","
"\"gating param n\", \"gating param m\", \"gating param h\" # "
"subsets vector # SubsetHandler")
.add_method("set_conductances", &T::set_conductances, "", "g_K#g_Na", "")
.add_method("set_reversal_potentials", &T::set_reversal_potentials, "", "E_K#E_Na", "")
.add_method("set_reference_time", &T::set_reference_time, "", "reference time (in units of s)", "")
.add_method("set_temperature", &T::set_temperature, "", "temperature (in K)", "")
.add_method("use_exact_gating_mode", &T::use_exact_gating_mode, "", "time step size", "")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "HHSpecies", tag);
}
// RyRinstat (time-dep. RyR implementation)
{
typedef RyRinstat<TDomain> T;
typedef IMembraneTransporter TBase;
std::string name = std::string("RyRinstat").append(suffix);
reg.add_class_<T, TBase>(name, grp)
.template add_constructor<void (*)(const char*, const char*, SmartPtr<ApproximationSpace<TDomain> >)>
("Functions as comma-separated string with the order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\"} # "
"subsets as comma-separated string # approximation space")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&, SmartPtr<ApproximationSpace<TDomain> >)>
("Function vector with the order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\"} # "
"subsets vector, approximation space")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "RyRinstat", tag);
}
// fully implicit RyR
{
typedef RyRImplicit<TDomain> T;
typedef IMembraneTransporter TBase1;
typedef IElemDisc<TDomain> TBase2;
std::string name = std::string("RyRImplicit").append(suffix);
reg.add_class_<T, TBase1, TBase2>(name, grp)
.template add_constructor<void (*)(const char*, const char*)>
("Functions as comma-separated string with the order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\", \"O2 channel state\", \"C1 channel state\", \"C2 channel state\"} # "
"subsets as comma-separated string")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>
("Function vector with the order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\", \"O2 channel state\", \"C1 channel state\", \"C2 channel state\"} # "
"subsets vector,")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "RyRImplicit", tag);
}
// fully implicit RyR (special case 1d, rotationally symmetric "cable")
{
typedef RyRImplicit_1drotsym<TDomain> T;
typedef IElemDisc<TDomain> TBase;
std::string name = std::string("RyRImplicit_1drotsym").append(suffix);
reg.add_class_<T, TBase>(name, grp)
.template add_constructor<void (*)(const char*, const char*)>
("Functions as comma-separated string with the order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\", \"O2 channel state\", \"C1 channel state\", \"C2 channel state\"} # "
"subsets as comma-separated string")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>
("Function vector with the order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\", \"O2 channel state\", \"C1 channel state\", \"C2 channel state\"} # "
"subsets vector,")
.add_method("set_calcium_scale", &T::set_calcium_scale, "", "cytosolic calcium scale", "")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "RyRImplicit_1drotsym", tag);
}
// linearized RyR
{
typedef RyRLinearized<TDomain> T;
typedef IMembraneTransporter TBase1;
typedef IElemDisc<TDomain> TBase2;
std::string name = std::string("RyRLinearized").append(suffix);
reg.add_class_<T, TBase1, TBase2>(name, grp)
.template add_constructor<void (*)(const char*, const char*)>
("Functions as comma-separated string with the order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\", \"O2 channel state\", \"C1 channel state\", \"C2 channel state\"} # "
"subsets as comma-separated string")
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&)>
("Function vector with the order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\", \"O2 channel state\", \"C1 channel state\", \"C2 channel state\"} # "
"subsets vector,")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "RyRLinearized", tag);
}
// VDCC base type
{
typedef VDCC_BG<TDomain> T;
typedef IMembraneTransporter TBase1;
typedef IElemDisc<TDomain> TBase2;
std::string name = std::string("VDCC_BG").append(suffix);
reg.add_class_<T, TBase1, TBase2>(name, grp)
.add_method("set_channel_type_N", &T::template set_channel_type<T::BG_Ntype>,
"", "", "set the channel type to N")
.add_method("set_channel_type_L", &T::template set_channel_type<T::BG_Ltype>,
"", "", "set the channel type to L")
.add_method("set_channel_type_T", &T::template set_channel_type<T::BG_Ttype>,
"", "", "set the channel type to T")
.add_method("init", &T::init, "", "time", "initialize the Borg-Graham object")
.add_method("export_membrane_potential_to_vtk", &T::export_membrane_potential_to_vtk,
"", "file name # step # time", "writes the current membrane potential data to vtk file");
reg.add_class_to_group(name, "VDCC_BG", tag);
}
// VDCC with UserData
{
typedef VDCC_BG_UserData<TDomain> T;
typedef VDCC_BG<TDomain> TBase;
std::string name = std::string("VDCC_BG_UserData").append(suffix);
reg.add_class_<T, TBase>(name, grp)
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&, SmartPtr<ApproximationSpace<TDomain> >)>
("function(s) as vector#subset(s) as vector#approxSpace")
.template add_constructor<void (*)(const char*, const char*, SmartPtr<ApproximationSpace<TDomain> >)>
("function(s) as comma-separated c-string#subset(s) as comma-separated c-string#approxSpace")
.add_method("set_potential_function", static_cast<void (T::*) (const number)> (&T::set_potential_function),
"", "", "add a potential function")
.add_method("set_potential_function", static_cast<void (T::*) (const char*)> (&T::set_potential_function),
"", "", "add a potential function")
.add_method("set_potential_function", static_cast<void (T::*) (SmartPtr<CplUserData<number, dim> >)> (&T::set_potential_function),
"", "", "add a potential function")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "VDCC_BG_UserData", tag);
}
#ifdef NC_WITH_MPM
// VDCC with Vm2UG
{
typedef VDCC_BG_VM2UG<TDomain> T;
typedef VDCC_BG<TDomain> TBase;
std::string name = std::string("VDCC_BG_VM2UG").append(suffix);
reg.add_class_<T, TBase>(name, grp)
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&,
SmartPtr<ApproximationSpace<TDomain> >, const std::string, const char*, const std::string, const bool)>
("function(s) as vector#subset(s) as vector#approxSpace#baseNameVmFile#timeFormat#extensionVmFile#fileInterval#fileOffset#vertexOrderOrPositionCanChange")
.template add_constructor<void (*)(const char*, const char*,
SmartPtr<ApproximationSpace<TDomain> >, const std::string, const char*, const std::string, const bool)>
("function(s) as comma-separated c-string#subset(s) as comma-separated c-string#approxSpace#baseNameVmFile#timeFormat#extensionVmFile#fileInterval#fileOffset#vertexOrderOrPositionCanChange")
.add_method("set_file_times", &T::set_file_times, "", "file interval#file offset (first file)", "set times for which files with potential values are available")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "VDCC_BG_VM2UG", tag);
}
// VDCC with Neuron
#ifdef NC_WITH_NEURON
{
typedef VDCC_BG_VM2UG_NEURON<TDomain> T;
typedef VDCC_BG<TDomain> TBase;
std::string name = std::string("VDCC_BG_VM2UG_NEURON").append(suffix);
reg.add_class_<T, TBase>(name, grp)
.template add_constructor<void (*)(const std::vector<std::string>&, const std::vector<std::string>&,
SmartPtr<ApproximationSpace<TDomain> >, SmartPtr<membrane_potential_mapping::Transformator>, const std::string, const char*, const std::string, const bool)>
("function(s) as vector#subset(s) as vector#approxSpace#baseNameVmFile#timeFormat#extensionVmFile#vertexOrderOrPositionCanChange")
.template add_constructor<void (*)(const char*, const char*,
SmartPtr<ApproximationSpace<TDomain> >, SmartPtr<membrane_potential_mapping::Transformator>, const std::string, const char*, const std::string, const bool)>
("function(s) as comma-separated c-string#subset(s) as comma-separated c-string#approxSpace#baseNameVmFile#timeFormat#extensionVmFile#vertexOrderOrPositionCanChange")
.add_method("set_transformator", static_cast<void (T::*) (SmartPtr<membrane_potential_mapping::Transformator>)> (&T::set_transformator), "", "", "")
.add_method("set_provider", static_cast<void (T::*) (SmartPtr<membrane_potential_mapping::Mapper<TDomain::dim, number> >)> (&T::set_provider), "", "", "")
.add_method("set_mapper", static_cast<void (T::*) (SmartPtr<membrane_potential_mapping::NeuronMPM>)> (&T::set_mapper), "", "", "")
.set_construct_as_smart_pointer(true);
reg.add_class_to_group(name, "VDCC_BG_VM2UG_NEURON", tag);
}
#endif // NC_WITH_NEURON
#endif // NC_WITH_MPM
// mark for refinement functions
{
reg.add_function("adjust_attachments", &adjust_attachments<TDomain>, grp.c_str(), "", "domain", "");
reg.add_function("mark_anisotropic_in_local_neurite_direction", &mark_anisotropic_in_local_neurite_direction<TDomain>, grp.c_str(), "", "refiner#domain#anisotropy threshold (<=1)", "");
reg.add_function("unmark_ranvier_areas", &unmark_ranvier_areas<TDomain>, grp.c_str(), "", "refiner#approx space#ranvier node subsets#unmark", "");
}
// extra commands for this plugin
reg.add_function("compute_volume", static_cast<void (*) (ConstSmartPtr<ApproximationSpace<TDomain> >, const char*)>(&computeVolume<TDomain>), grp.c_str(),
"", "approxSpace#subsetNames", "outputs subset volumes");
reg.add_function("compute_volume_of_subset", static_cast<number (*) (ConstSmartPtr<ApproximationSpace<TDomain> >, int)>(&computeVolume<TDomain>), grp.c_str(),
"volume of the subset", "approxSpace # subset index", "calculates subset volume");
reg.add_function("RemoveAllNonDefaultRefinementProjectors", &RemoveAllNonDefaultRefinementProjectors<TDomain>);
reg.add_function("PathLength1D", static_cast<number (*)(const std::string&, const std::string&, const std::string&, TDomain&)>(&PathLength1D<TDomain>), "length", "1d domain#from subset#to subset#3d domain");
}
/**
* 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 IMembraneTransporter T;
std::string name = std::string("MembraneTransporter");
reg.add_class_<T>(name, grp)
.add_method("set_constant", &T::set_constant, "", "index i#value v",
"sets a constant value v for the i-th passed unknown", "")
.add_method("num_fluxes", &T::n_fluxes, "number of fluxes this transport mechanism calculates", "", "", "")
.add_method("print_units", &T::print_units, "", "",
"prints out the units used in the implementation of this membrane transport mechanism", "")
.add_method("set_scale_inputs", &T::set_scale_inputs, "", "scaling factors (same number and order as for the constructor)",
"Sets scaling factors for conversion of user's input variable units to the units of the implementation of "
"this membrane transport mechanism.", "Default values: 1.0 (no scaling).")
.add_method("set_scale_input", &T::set_scale_input, "", "index#scaling factor",
"Sets a scaling factor for conversion of the user's input variable (specified by first parameter) units to the "
"units of the implementation of this membrane transport mechanism.", "")
.add_method("set_scale_fluxes", &T::set_scale_fluxes, "", "scaling factors",
"Sets scaling factors for conversion of calculated fluxes to the units employed by the user.",
"Default values: 1.0 (no scaling).")
.add_method("set_scale_flux", &T::set_scale_flux, "", "index#scaling factor",
"Sets a scaling factor for conversion of the calculated flux (specified by first parameter) to the unit employed "
"by the user.", "");
//.add_method("calc_flux", static_cast<number (T::*) (const std::vector<number>&, size_t) const>(&T::calc_flux), "", "input values#flux index#output flux",
// "calculates the specified flux through this mechanism", "");
/* does not work, since vectors have to be const for exchange with lua
.add_method("calc_flux", &T::calc_flux, "", "input values#output flux(es)",
"calculates the flux(es) through this mechanism", "")
.add_method("calc_flux_deriv", &T::calc_flux_deriv, "", "input values#output flux derivatives",
"calculates the flux derivatives through this mechanism", "");
*/
}
{
typedef OhmicLeakage T;
typedef IMembraneTransporter TBase;
std::string name = std::string("OhmicLeakage");
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)(const char*)>
("Functions as comma-separated string with the following order: "
"\"inner charge density\", \"outer charge density\", \"inner potential\", \"outer potential\"")
.add_constructor<void (*)(const std::vector<std::string>&)>
("Function vector with the following order: "
"\"inner charge density\", \"outer charge density\", \"inner potential\", \"outer potential\"")
.add_method("set_conductance", &T::set_conductance, "", "g_L", "")
.add_method("set_reversal_potential", &T::set_reversal_potential, "", "E_L", "")
.set_construct_as_smart_pointer(true);
}
{
typedef OhmicLeakageCharges T;
typedef IMembraneTransporter TBase;
std::string name = std::string("OhmicLeakageCharges");
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)(const char*)>
("Functions as comma-separated string with the following order: "
"\"inner charge density\", \"outer charge density\", \"inner potential\", \"outer potential\"")
.add_constructor<void (*)(const std::vector<std::string>&)>
("Function vector with the following order: "
"\"inner charge density\", \"outer charge density\", \"inner potential\", \"outer potential\"")
.add_method("set_conductance", &T::set_conductance, "", "g_L", "")
.add_method("set_reversal_potential", &T::set_reversal_potential, "", "E_L", "")
.set_construct_as_smart_pointer(true);
}
{
typedef IP3R T;
typedef IMembraneTransporter TBase;
std::string name = std::string("IP3R");
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)(const char*)>
("Functions as comma-separated string with the following order: "
"\"cytosolic calcium, endoplasmic calcium, ip3\"")
.add_constructor<void (*)(const std::vector<std::string>&)>
("Function vector with the following order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\", \"ip3\"}")
.set_construct_as_smart_pointer(true);
}
{
typedef RyR T;
typedef IMembraneTransporter TBase;
std::string name = std::string("RyR");
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)(const char* )>
("Functions as comma-separated string with the following order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\"}")
.add_constructor<void (*)(const std::vector<std::string>&)>
("Function vector with the following order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\"}")
.set_construct_as_smart_pointer(true);
}
{
typedef SERCA T;
typedef IMembraneTransporter TBase;
std::string name = std::string("SERCA");
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)(const char*)>
("Functions as comma-separated string with the following order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\"}")
.add_constructor<void (*)(const std::vector<std::string>&)>
("Function vector with the following order: "
"{\"cytosolic calcium\", \"endoplasmic calcium\"}")
.add_method("set_linearized_assembling", &T::set_linearized_assembling)
.set_construct_as_smart_pointer(true);
}
{
typedef Leak T;
typedef IMembraneTransporter TBase;
std::string name = std::string("Leak");
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)(const char*)>
("Functions as comma-separated string with the following order: "
"{\"source concentration\", \"target concentration\" [, "
"\"source potential\", \"target potential\"]}")
.add_constructor<void (*)(const std::vector<std::string>&)>
("Function vector with the following order: "
"{\"source concentration\", \"target concentration\" [, "
"\"source potential\", \"target potential\"]}")
.add_method("set_permeability", &T::set_permeability, "", "permeability", "")
.add_method("set_temperature", &T::set_temperature, "", "temperature (K)", "")
.add_method("set_valency", &T::set_valency, "", "valency", "")
.set_construct_as_smart_pointer(true);
}
{
typedef PMCA T;
typedef IMembraneTransporter TBase;
std::string name = std::string("PMCA");
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)(const char*)>
("Functions as comma-separated string with the following order: "
"{\"cytosolic calcium\", \"extracellular calcium\"}")
.add_constructor<void (*)(const std::vector<std::string>&)>
("Function vector with the following order: "
"{\"cytosolic calcium\", \"extracellular calcium\"}")
.add_method("set_linearized_assembling", &T::set_linearized_assembling)
.set_construct_as_smart_pointer(true);
}
{
typedef NCX T;
typedef IMembraneTransporter TBase;
std::string name = std::string("NCX");
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)(const char*)>
("Functions as comma-separated string with the following order: "
"{\"cytosolic calcium\", \"extracellular calcium\"}")
.add_constructor<void (*)(const std::vector<std::string>&)>
("Function vector with the following order: "
"{\"cytosolic calcium\", \"extracellular calcium\"}")
.add_method("set_linearized_assembling", &T::set_linearized_assembling)
.set_construct_as_smart_pointer(true);
}
{
typedef MCU T;
typedef IMembraneTransporter TBase;
std::string name = std::string("MCU");
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)(const char*)>
("Functions as comma-separated string with the following order: "
"{\"cytosolic calcium\", \"mitochondrial calcium\"}")
.add_constructor<void (*)(const std::vector<std::string>&)>
("Function vector with the following order: "
"{\"cytosolic calcium\", \"mitochondrial calcium\"}")
.add_method("set_mit_volume", &T::set_mit_volume,
"Sets mitochondrial volume.")
.add_method("set_mit_surface", &T::set_mit_surface,
"Sets mitochondrial surface.")
.add_method("set_pi_cyt", &T::set_pi_cyt,
"Sets cytosolic phosphate concentration.")
.add_method("set_psi", &T::set_psi,
"Sets mitochondrial membrane potential.")
.add_method("set_mg_cyt", &T::set_mg_cyt,
"Sets cytosolic Mg2+ concentration.")
.add_method("set_mg_mit", &T::set_mg_mit,
"Sets mitochondrial Mg2+ concentration.")
.add_method("set_rate_constant", &T::set_rate_constant,
"Sets rate constant k.")
.add_method("get_flux", &T::get_flux, "Debug method.")
.set_construct_as_smart_pointer(true);
}
{
typedef MNCX T;
typedef IMembraneTransporter TBase;
std::string name = std::string("MNCX");
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)(const char*)>
("Functions as comma-separated string with the following order: "
"{\"cytosolic calcium\", \"mitochondrial calcium\", \"cytosolic sodium\", \"mitochondrial sodium\"}")
.add_constructor<void (*)(const std::vector<std::string>&)>
("Function vector with the following order: "
"{\"cytosolic calcium\", \"mitochondrial calcium\", \"cytosolic sodium\", \"mitochondrial sodium\"}")
.add_method("set_mit_volume", &T::set_mit_volume,
"Sets mitochondrial volume.")
.add_method("set_mit_surface", &T::set_mit_surface,
"Sets mitochondrial surface.")
.add_method("set_psi", &T::set_psi,
"Sets mitochondrial membrane potential.")
.add_method("get_flux", &T::get_flux, "Debug method.")
.set_construct_as_smart_pointer(true);
}
{
typedef NMDAR T;
typedef IMembraneTransporter TBase;
std::string name = std::string("NMDAR");
reg.add_class_<T, TBase>(name, grp)
.add_constructor<void (*)(const char*)>
("Functions as comma-separated string with the following order: "
"extracellular calcium, intracellular calcium")
.add_constructor<void (*)(const std::vector<std::string>&)>
("Function vector with the following order: {extracellular calcium, intracellular calcium}")
.add_method("set_activation_time", &T::set_activation_time, "", "", "")
.add_method("set_decay_time", &T::set_decay_time, "", "", "")
.add_method("set_permeability", &T::set_permeability, "", "", "")
.add_method("set_membrane_potential", &T::set_membrane_potential, "", "", "")
.add_method("set_temperature", &T::set_temperature, "", "", "")
.set_construct_as_smart_pointer(true);
}
{
typedef ActionPotentialTrain T;
std::string name = std::string("ActionPotentialTrain");
reg.add_class_<T>(name, grp)
.add_constructor()
.add_constructor<void (*)(number, number, number, number)>
("stimBegin#stimEnd#stimFreq#basicVoltage")
.add_method("membrane_potential", &T::membrane_potential,
"Returns membrane potential to given frequency stimulation interval.")
.set_construct_as_smart_pointer(true);
}
// build bouton
{
reg.add_function("BuildBouton", &BuildBouton, grp,
"", "bExtSpace#radius#numRefinements#numReleaseSites#TbarHeight#TbarLegRadius#TbarTopRadius#TbarTopHeight#fileName",
"Generates a drosophila NMJ bouton volume grid.");
}
// build spine
{
// TODO: Rename "BuildSpine", remove ineffective parameters
reg.add_function("BuildDendrite", &BuildSpine, grp,
"", "geometric param vector (cytosol radius, ER radius, dendrite length, spine position, "
"spine ER neck radius, spine ER neck length, spine ER head radius, spine ER head length, "
"spine neck radius, spine neck length, spine head radius, spine head length)"
"options vector (build a synapse? [ineffective], build ER?, build spine ER?, "
"synapse at different location? [ineffective], build spine ER head?)"
"#fileName",
"Generates a dendritic spine with a portion of the connected dendrite.");
}
// DendriteGenerator
{
typedef DendriteGenerator T;
string name = string("DendriteGenerator");
reg.add_class_<T>(name, grp)
.add_constructor()
.add_method("set_dendrite_length", &T::set_dendrite_length, "", "", "")
.add_method("set_dendrite_radius", &T::set_dendrite_radius, "", "", "")
.add_method("set_er_radius", &T::set_er_radius, "", "", "")
.add_method("set_synapse_area", &T::set_synapse_area, "", "", "")
.add_method("set_num_segments", &T::set_num_segments, "", "", "")
.add_method("num_segments", &T::num_segments, "", "", "")
.add_method("create_dendrite_middle_influx", &T::create_dendrite_middle_influx, "", "", "")
.add_method("create_dendrite", &T::create_dendrite, "", "", "")
.add_method("create_dendrite_1d", &T::create_dendrite_1d, "", "", "")
.add_method("create_dendrite_discreteRyR", &T::create_dendrite_discreteRyR, "", "", "")
.add_method("set_bobbel_er", &T::set_bobbel_er, "", "numSeg / ER block # numSeg / hole block", "")
.set_construct_as_smart_pointer(true);
}
#ifndef UG_FOR_VRL
// neurites from swc
{
reg.add_function("import_neurites_from_swc", &neurites_from_swc::import_neurites_from_swc, "",
"file name # anisotropy # refinements", "");
reg.add_function("import_er_neurites_from_swc", &neurites_from_swc::import_er_neurites_from_swc, "",
"swc file name (input) # ugx file name (output) # ER scale factor # anisotropy # refinements", "");
reg.add_function("import_1d_neurites_from_swc", &neurites_from_swc::import_1d_neurites_from_swc, "",
"file name # anisotropy # refinements", "");
}
// test neurite projector
{