-
Notifications
You must be signed in to change notification settings - Fork 0
/
HSolve.h
188 lines (137 loc) · 4.64 KB
/
HSolve.h
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
/**********************************************************************
** This program is part of 'MOOSE', the
** Messaging Object Oriented Simulation Environment.
** copyright (C) 2003-2007 Upinder S. Bhalla, Niraj Dudani and NCBS
** It is made available under the terms of the
** GNU Lesser General Public License version 2.1
** See the file COPYING.LIB for the full notice.
**********************************************************************/
#ifndef _HSOLVE_H
#define _HSOLVE_H
#include <set>
#include "HSolveActive.h"
/**
* HSolve adapts the integrator HSolveActive into a MOOSE class.
*/
class HSolve: public HSolveActive
{
public:
friend class pn2s::Device;
friend class PN2S_Proxy;
HSolve();
~HSolve();
void process( const Eref& hsolve, ProcPtr p );
void reinit( const Eref& hsolve, ProcPtr p );
void setSeed( Id seed );
Id getSeed() const; /**< For searching for compartments:
* seed is the starting compt. */
void setPath( const Eref& e, string path );
string getPath( const Eref& e ) const;
/**< Path to the compartments */
void setDt( double dt );
double getDt() const;
void setCaAdvance( int caAdvance );
int getCaAdvance() const;
void setVDiv( int vDiv );
int getVDiv() const;
void setVMin( double vMin );
double getVMin() const;
void setVMax( double vMax );
double getVMax() const;
void setCaDiv( int caDiv );
int getCaDiv() const;
void setCaMin( double caMin );
double getCaMin() const;
void setCaMax( double caMax );
double getCaMax() const;
// Interface functions defined in HSolveInterface.cpp
double getInitVm( Id id ) const;
void setInitVm( Id id, double value );
//Required by GPU kernels
double getHS2( Id id );
double getVm( Id id ) const;
void setVm( Id id, double value );
double getCm( Id id ) const;
void setCm( Id id, double value );
double getEm( Id id ) const;
void setEm( Id id, double value );
double getRm( Id id ) const;
void setRm( Id id, double value );
double getRa( Id id ) const;
void setRa( Id id, double value );
// Im is read-only
double getIm( Id id ) const;
// Ia is read-only
double getIa( Id id ) const;
double getInject( Id id ) const;
void setInject( Id id, double value );
void addInject( Id id, double value );
/// Interface to compartments
//~ const vector< Id >& getCompartments() const;
void addGkEk( Id id, double v1, double v2 );
/// Interface to channels
//~ const vector< Id >& getHHChannels() const;
void setPowers(
Id id,
double Xpower,
double Ypower,
double Zpower );
//Extra method to feed GPU data
void setXparams(Id id, vector<double> params);
void setYparams(Id id, vector<double> params);
void setZparams(Id id, vector<double> params);
int getInstant( Id id ) const;
void setInstant( Id id, int instant );
double getHHChannelGbar( Id id ) const;
void setHHChannelGbar( Id id, double value );
double getEk( Id id ) const;
void setEk( Id id, double value );
double getGk( Id id ) const;
void setGk( Id id, double value );
// Ik is read-only
double getIk( Id id ) const;
double getX( Id id ) const;
void setX( Id id, double value );
double getY( Id id ) const;
void setY( Id id, double value );
double getZ( Id id ) const;
void setZ( Id id, double value );
/// Interface to CaConc
//~ const vector< Id >& getCaConcs() const;
double getCa( Id id ) const;
void setCa( Id id, double Ca );
double getCaBasal( Id id ) const;
void setCaBasal( Id id, double CaBasal );
void setTauB( Id id, double tau, double B );
double getCaCeiling( Id id ) const;
void setCaCeiling( Id id, double floor );
double getCaFloor( Id id ) const;
void setCaFloor( Id id, double floor );
double getEmByRm( Id id ) const;
double getCmByDt( Id id ) const;
/// Interface to external channels
//~ const vector< vector< Id > >& getExternalChannels() const;
static const Cinfo* initCinfo();
static const std::set<string>& handledClasses();
/**< Returns the set of classes "handled" by HSolve */
static void deleteIncomingMessages( Element * orig, const string finfo);
/**< Delete messages coming into this particular
* element if its class that is handled by HSolve */
private:
static vector< Id > children( Id obj );
static Id deepSearchFor( Id base, const string& name );
void setup( Eref hsolve );
void zombify( Eref hsolve ) const;
// Mapping global Id to local index. Defined in HSolveInterface.cpp.
void mapIds();
void mapIds( vector< Id > id );
unsigned int localIndex( Id id ) const;
map< Id, unsigned int > localIndex_;
double dt_;
string path_;
vector<Id> seeds_;
bool isMasterHSolve_;
bool isSubSolver_;
// bool isEngine_;
};
#endif // _HSOLVE_H