MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <HHGate.h>
Public Member Functions | |
bool | checkOriginal (Id id, const string &field) const |
vector< double > | getAlpha (const Eref &e) const |
vector< double > | getAlphaParms (const Eref &e) const |
vector< double > | getBeta (const Eref &e) const |
unsigned int | getDivs (const Eref &e) const |
double | getMax (const Eref &e) const |
double | getMin (const Eref &e) const |
vector< double > | getMinfinity (const Eref &e) const |
vector< double > | getTableA (const Eref &e) const |
vector< double > | getTableB (const Eref &e) const |
vector< double > | getTau (const Eref &e) const |
bool | getUseInterpolation (const Eref &e) const |
HHGate () | |
HHGate (Id originalChanId, Id originalGateId) | |
bool | isOriginalChannel (Id id) const |
bool | isOriginalGate (Id id) const |
double | lookupA (double v) const |
double | lookupB (double v) const |
void | lookupBoth (double v, double *A, double *B) const |
double | lookupTable (const vector< double > &tab, double v) const |
Id | originalChannelId () const |
Id | originalGateId () const |
void | setAlpha (const Eref &e, vector< double > val) |
void | setBeta (const Eref &e, vector< double > val) |
void | setDivs (const Eref &e, unsigned int val) |
void | setMax (const Eref &e, double val) |
void | setMin (const Eref &e, double val) |
void | setMinfinity (const Eref &e, vector< double > val) |
void | setTableA (const Eref &e, vector< double > v) |
void | setTableB (const Eref &e, vector< double > v) |
void | setTau (const Eref &e, vector< double > val) |
void | setupAlpha (const Eref &e, vector< double > parms) |
void | setupGate (const Eref &e, vector< double > parms) |
void | setupTables (const vector< double > &parms, bool doTau) |
void | setupTau (const Eref &e, vector< double > parms) |
void | setUseInterpolation (const Eref &e, bool val) |
void | tabFill (vector< double > &table, unsigned int newXdivs, double newXmin, double newXmax) |
void | tweakAlpha () |
void | tweakTables (bool doTau) |
void | tweakTau () |
void | updateAlphaBeta () |
void | updateTables () |
void | updateTauMinf () |
Static Public Member Functions | |
static const Cinfo * | initCinfo () |
Private Attributes | |
vector< double > | A_ |
The actual lookup table for calculations. Holds alpha(V). More... | |
vector< double > | alpha_ |
5 parameters for alpha More... | |
vector< double > | B_ |
The lookup table for calculations. Holds alpha(V) + beta(V). More... | |
vector< double > | beta_ |
5 parameters for beta More... | |
double | invDx_ |
increment of the range. More... | |
bool | isDirectTable_ |
bool | lookupByInterpolation_ |
vector< double > | mInfinity_ |
5 parameters for mInfinity More... | |
Id | originalChanId_ |
Id | originalGateId_ |
vector< double > | tau_ |
5 parameters for tau More... | |
double | xmax_ |
Max of the voltage (or conc) range. More... | |
double | xmin_ |
Minimum of the voltage (or conc) range. More... | |
Friends | |
void | testHHGateLookup () |
void | testHHGateSetup () |
This class handles a single gate on an HHChannel. It is equivalent to the m and h terms on the Hodgkin-Huxley Na channel, or the n term on the K channel. It stores the voltage-dependence (sometimes concentration-dependence) of the gating variables for opening the channel. It does so in a tabular form which can be directly filled using experimental data points. It also provides a set of utility functions for defining the gate in functional forms, and accessing those original functional forms. The HHGate is accessed as a FieldElement, which means that it is available as a pointer on the HHChannel. HHGates are typically shared. This means that when you make a copy or a vector of an HHChannel, there is only a single HHGate created, and its pointer is used by all the copies. The lookup functions are thread-safe. Field assignment to the HHGate should be possible only from the original HHChannel, but all the others do have read permission.
HHGate::HHGate | ( | ) |
Dummy constructor, to keep Dinfo happy. Should never be used
Definition at line 227 of file HHGate.cpp.
This constructor is the one meant to be used. It takes the originalId of the parent HHChannel as a required argument, so that any subsequent 'write' functions can be checked to see if they are legal. Also tracks its own Id.
Definition at line 235 of file HHGate.cpp.
bool HHGate::checkOriginal | ( | Id | id, |
const string & | field | ||
) | const |
Checks if the provided Id is the one that the HHGate was created on. If true, fine, otherwise complains about trying to set the field.
Definition at line 776 of file HHGate.cpp.
References originalGateId_.
Referenced by setAlpha(), setBeta(), setDivs(), setMax(), setMin(), setMinfinity(), setTableA(), setTableB(), setTau(), setupAlpha(), setupGate(), setupTau(), and setUseInterpolation().
vector< double > HHGate::getAlpha | ( | const Eref & | e | ) | const |
Definition at line 298 of file HHGate.cpp.
References alpha_.
Referenced by initCinfo().
vector< double > HHGate::getAlphaParms | ( | const Eref & | e | ) | const |
Definition at line 509 of file HHGate.cpp.
References A_, alpha_, beta_, xmax_, and xmin_.
Referenced by initCinfo().
vector< double > HHGate::getBeta | ( | const Eref & | e | ) | const |
Definition at line 318 of file HHGate.cpp.
References beta_.
Referenced by initCinfo().
unsigned int HHGate::getDivs | ( | const Eref & | e | ) | const |
Definition at line 421 of file HHGate.cpp.
References A_.
Referenced by initCinfo().
double HHGate::getMax | ( | const Eref & | e | ) | const |
Definition at line 399 of file HHGate.cpp.
References xmax_.
Referenced by initCinfo().
double HHGate::getMin | ( | const Eref & | e | ) | const |
Definition at line 378 of file HHGate.cpp.
References xmin_.
Referenced by initCinfo().
vector< double > HHGate::getMinfinity | ( | const Eref & | e | ) | const |
Definition at line 358 of file HHGate.cpp.
References mInfinity_.
Referenced by initCinfo().
vector< double > HHGate::getTableA | ( | const Eref & | e | ) | const |
Definition at line 443 of file HHGate.cpp.
References A_.
Referenced by initCinfo().
vector< double > HHGate::getTableB | ( | const Eref & | e | ) | const |
Definition at line 463 of file HHGate.cpp.
References B_.
Referenced by initCinfo().
vector< double > HHGate::getTau | ( | const Eref & | e | ) | const |
Definition at line 338 of file HHGate.cpp.
References tau_.
Referenced by initCinfo().
bool HHGate::getUseInterpolation | ( | const Eref & | e | ) | const |
Definition at line 480 of file HHGate.cpp.
References lookupByInterpolation_.
Referenced by initCinfo().
|
static |
Definition at line 16 of file HHGate.cpp.
References getAlpha(), getAlphaParms(), getBeta(), getDivs(), getMax(), getMin(), getMinfinity(), getTableA(), getTableB(), getTau(), getUseInterpolation(), Neutral::initCinfo(), lookupA(), lookupB(), setAlpha(), setBeta(), setDivs(), setMax(), setMin(), setMinfinity(), setTableA(), setTableB(), setTau(), setupAlpha(), setupGate(), setupTau(), setUseInterpolation(), tweakAlpha(), and tweakTau().
Referenced by HHChannelBase::initCinfo().
bool HHGate::isOriginalChannel | ( | Id | id | ) | const |
isOriginalChannel returns true if the provided Id is the Id of the channel on which the HHGate was created.
Definition at line 786 of file HHGate.cpp.
References originalChanId_.
Referenced by HHChannel::checkOriginal().
bool HHGate::isOriginalGate | ( | Id | id | ) | const |
isOriginalChannel returns true if the provided Id is the Id of the Gate created at the same time as the original channel.
Definition at line 791 of file HHGate.cpp.
References originalGateId_.
double HHGate::lookupA | ( | double | v | ) | const |
lookupA: Look up the A vector from a double. Typically does so by direct scaling and offset to an integer lookup, using a fine enough table granularity that there is little error. Alternatively uses linear interpolation. The range of the double is predefined based on knowledge of voltage or conc ranges, and the granularity is specified by the xmin, xmax, and invDx fields.
Definition at line 265 of file HHGate.cpp.
References A_, and lookupTable().
Referenced by initCinfo().
double HHGate::lookupB | ( | double | v | ) | const |
lookupB: Look up the B vector from a double, similar to lookupA.
Definition at line 270 of file HHGate.cpp.
References B_, and lookupTable().
Referenced by initCinfo().
void HHGate::lookupBoth | ( | double | v, |
double * | A, | ||
double * | B | ||
) | const |
Single call to get both A and B values by lookup
Definition at line 275 of file HHGate.cpp.
References A_, B_, invDx_, lookupByInterpolation_, xmax_, and xmin_.
Referenced by HSolveUtils::rates(), HHChannel::vProcess(), and HHChannel::vReinit().
double HHGate::lookupTable | ( | const vector< double > & | tab, |
double | v | ||
) | const |
Returns looked up value of specified table
Definition at line 250 of file HHGate.cpp.
References invDx_, lookupByInterpolation_, xmax_, and xmin_.
Referenced by lookupA(), lookupB(), and tabFill().
Id HHGate::originalChannelId | ( | ) | const |
Returns the Id of the original Channel.
Definition at line 796 of file HHGate.cpp.
References originalChanId_.
Id HHGate::originalGateId | ( | ) | const |
Returns the Id of the original Gate.
Definition at line 801 of file HHGate.cpp.
References originalGateId_.
Referenced by HSolveUtils::gates(), and HSolveUtils::rates().
void HHGate::setAlpha | ( | const Eref & | e, |
vector< double > | val | ||
) |
Definition at line 303 of file HHGate.cpp.
References alpha_, checkOriginal(), Eref::id(), Id::path(), updateTables(), and updateTauMinf().
Referenced by initCinfo().
void HHGate::setBeta | ( | const Eref & | e, |
vector< double > | val | ||
) |
Definition at line 323 of file HHGate.cpp.
References beta_, checkOriginal(), Eref::id(), Id::path(), updateTables(), and updateTauMinf().
Referenced by initCinfo().
void HHGate::setDivs | ( | const Eref & | e, |
unsigned int | val | ||
) |
Stuff here to redo sizes.
Definition at line 426 of file HHGate.cpp.
References A_, B_, checkOriginal(), Eref::id(), invDx_, isDirectTable_, tabFill(), updateTables(), xmax_, and xmin_.
Referenced by initCinfo().
void HHGate::setMax | ( | const Eref & | e, |
double | val | ||
) |
Definition at line 404 of file HHGate.cpp.
References A_, B_, checkOriginal(), Eref::id(), invDx_, isDirectTable_, tabFill(), updateTables(), xmax_, and xmin_.
Referenced by initCinfo().
void HHGate::setMin | ( | const Eref & | e, |
double | val | ||
) |
Definition at line 383 of file HHGate.cpp.
References A_, B_, checkOriginal(), Eref::id(), invDx_, isDirectTable_, tabFill(), updateTables(), xmax_, and xmin_.
Referenced by initCinfo().
void HHGate::setMinfinity | ( | const Eref & | e, |
vector< double > | val | ||
) |
Definition at line 363 of file HHGate.cpp.
References checkOriginal(), Eref::id(), mInfinity_, Id::path(), updateAlphaBeta(), and updateTables().
Referenced by initCinfo().
void HHGate::setTableA | ( | const Eref & | e, |
vector< double > | v | ||
) |
Definition at line 448 of file HHGate.cpp.
References A_, checkOriginal(), Eref::id(), invDx_, isDirectTable_, Id::path(), xmax_, and xmin_.
Referenced by initCinfo().
void HHGate::setTableB | ( | const Eref & | e, |
vector< double > | v | ||
) |
Definition at line 468 of file HHGate.cpp.
References A_, B_, checkOriginal(), Eref::id(), and isDirectTable_.
Referenced by initCinfo().
void HHGate::setTau | ( | const Eref & | e, |
vector< double > | val | ||
) |
Definition at line 343 of file HHGate.cpp.
References checkOriginal(), Eref::id(), Id::path(), tau_, updateAlphaBeta(), and updateTables().
Referenced by initCinfo().
void HHGate::setupAlpha | ( | const Eref & | e, |
vector< double > | parms | ||
) |
Definition at line 491 of file HHGate.cpp.
References alpha_, beta_, checkOriginal(), Eref::id(), and setupTables().
Referenced by initCinfo().
void HHGate::setupGate | ( | const Eref & | e, |
vector< double > | parms | ||
) |
Definition at line 674 of file HHGate.cpp.
References A_, B_, checkOriginal(), Eref::id(), SINGULARITY, tabFill(), tweakTables(), xmax_, and xmin_.
Referenced by initCinfo().
void HHGate::setupTables | ( | const vector< double > & | parms, |
bool | doTau | ||
) |
Sets up the tables one at a time. Based on GENESIS/src/olf/new_interp.c, function setup_tab_values, fine tuned by Erik De Schutter.
Definition at line 551 of file HHGate.cpp.
References A_, B_, invDx_, SINGULARITY, xmax_, and xmin_.
Referenced by setupAlpha(), setupTau(), and updateTables().
void HHGate::setupTau | ( | const Eref & | e, |
vector< double > | parms | ||
) |
Definition at line 524 of file HHGate.cpp.
References checkOriginal(), Eref::id(), and setupTables().
Referenced by initCinfo().
void HHGate::setUseInterpolation | ( | const Eref & | e, |
bool | val | ||
) |
Definition at line 485 of file HHGate.cpp.
References checkOriginal(), Eref::id(), and lookupByInterpolation_.
Referenced by initCinfo(), and HSolveUtils::rates().
void HHGate::tabFill | ( | vector< double > & | table, |
unsigned int | newXdivs, | ||
double | newXmin, | ||
double | newXmax | ||
) |
tabFill does interpolation and range resizing for a table representing a lookup function. newXdivs is one less than the size of the table; it is the number of subdivisions that the table represents. Does NOT alter the existing xmin and xmax, but it does resize the table.
This utility function does interpolation and range resizing for a table representing a lookup function. newXdivs is one less than the size of the table; it is the number of subdivisions that the table represents.
Definition at line 755 of file HHGate.cpp.
References lookupByInterpolation_, and lookupTable().
Referenced by setDivs(), setMax(), setMin(), and setupGate().
void HHGate::tweakAlpha | ( | ) |
Definition at line 536 of file HHGate.cpp.
Referenced by initCinfo().
void HHGate::tweakTables | ( | bool | doTau | ) |
Tweaks the A and B entries in the tables from the original alpha/beta or minf/tau values. See code in GENESIS/src/olf/new_interp.c, function tweak_tab_values
Definition at line 650 of file HHGate.cpp.
References A_, B_, and SINGULARITY.
Referenced by setupGate().
void HHGate::tweakTau | ( | ) |
Definition at line 541 of file HHGate.cpp.
Referenced by initCinfo().
void HHGate::updateAlphaBeta | ( | ) |
Update the alpha and beta parameters because the tau or minfinity tables have changed.
Definition at line 806 of file HHGate.cpp.
Referenced by setMinfinity(), and setTau().
void HHGate::updateTables | ( | ) |
Take the current alpha/beta parameters, and xdivs, xmin, xmax; and rebuild the tables.
Definition at line 814 of file HHGate.cpp.
References A_, alpha_, beta_, setupTables(), xmax_, and xmin_.
Referenced by setAlpha(), setBeta(), setDivs(), setMax(), setMin(), setMinfinity(), and setTau().
void HHGate::updateTauMinf | ( | ) |
Update the Tau and Minfinity parameters because the alpha or beta tables have changed.
Definition at line 810 of file HHGate.cpp.
Referenced by setAlpha(), and setBeta().
|
friend |
|
friend |
|
private |
The actual lookup table for calculations. Holds alpha(V).
Definition at line 199 of file HHGate.h.
Referenced by getAlphaParms(), getDivs(), getTableA(), lookupA(), lookupBoth(), setDivs(), setMax(), setMin(), setTableA(), setTableB(), setupGate(), setupTables(), tweakTables(), and updateTables().
|
private |
5 parameters for alpha
Definition at line 187 of file HHGate.h.
Referenced by getAlpha(), getAlphaParms(), setAlpha(), setupAlpha(), and updateTables().
|
private |
The lookup table for calculations. Holds alpha(V) + beta(V).
Definition at line 202 of file HHGate.h.
Referenced by getTableB(), lookupB(), lookupBoth(), setDivs(), setMax(), setMin(), setTableB(), setupGate(), setupTables(), and tweakTables().
|
private |
5 parameters for beta
Definition at line 190 of file HHGate.h.
Referenced by getAlphaParms(), getBeta(), setBeta(), setupAlpha(), and updateTables().
|
private |
increment of the range.
Definition at line 211 of file HHGate.h.
Referenced by lookupBoth(), lookupTable(), setDivs(), setMax(), setMin(), setTableA(), and setupTables().
|
private |
Flag to indicate if table entries have been assigned directly (as direct experimental data, or an externally defined V-dep function). When zero it means that the curve-fit forms from setupAlpha etc. have been used.
Definition at line 238 of file HHGate.h.
Referenced by setDivs(), setMax(), setMin(), setTableA(), and setTableB().
|
private |
Flag: Use linear interpolation for lookup if true, use direct table lookup if false.
Definition at line 230 of file HHGate.h.
Referenced by getUseInterpolation(), lookupBoth(), lookupTable(), setUseInterpolation(), and tabFill().
|
private |
5 parameters for mInfinity
Definition at line 196 of file HHGate.h.
Referenced by getMinfinity(), and setMinfinity().
|
private |
Id of original channel, the one which has actually allocated it, All other Elements have to treat the values as readonly.
Definition at line 217 of file HHGate.h.
Referenced by isOriginalChannel(), and originalChannelId().
|
private |
Id of original Gate, the one which was created with the original channel. All other Elements have to treat the values as readonly.
Definition at line 224 of file HHGate.h.
Referenced by checkOriginal(), isOriginalGate(), and originalGateId().
|
private |
|
private |
Max of the voltage (or conc) range.
Definition at line 208 of file HHGate.h.
Referenced by getAlphaParms(), getMax(), lookupBoth(), lookupTable(), setDivs(), setMax(), setMin(), setTableA(), setupGate(), setupTables(), and updateTables().
|
private |
Minimum of the voltage (or conc) range.
Definition at line 205 of file HHGate.h.
Referenced by getAlphaParms(), getMin(), lookupBoth(), lookupTable(), setDivs(), setMax(), setMin(), setTableA(), setupGate(), setupTables(), and updateTables().