MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ZombieCaConc.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2003-2007 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #include "header.h"
11 #include "../biophysics/CaConcBase.h"
12 
13 #include "HinesMatrix.h"
14 #include "HSolveStruct.h"
15 #include "HSolvePassive.h"
16 #include "RateLookup.h"
17 #include "HSolveActive.h"
18 #include "HSolve.h"
19 #include "ZombieCaConc.h"
20 
22 {
23  static string doc[] =
24  {
25  "Name", "ZombieCaConc",
26  "Author", "Upinder S. Bhalla, 2007, NCBS",
27  "Description", "ZombieCaConc: Calcium concentration pool. Takes current from a "
28  "channel and keeps track of calcium buildup and depletion by a "
29  "single exponential process. ",
30  };
31  static Dinfo< ZombieCaConc > dinfo;
32  static Cinfo zombieCaConcCinfo(
33  "ZombieCaConc",
35  0,
36  0,
37  &dinfo,
38  doc,
39  sizeof( doc )/ sizeof( string )
40  );
41 
42  return &zombieCaConcCinfo;
43 }
45 
47 
49 // Field function definitions
51 
52 void ZombieCaConc::vSetCa( const Eref& e, double Ca )
53 {
54  hsolve_->setCa( e.id(), Ca );
55 }
56 
57 double ZombieCaConc::vGetCa( const Eref& e ) const
58 {
59  return hsolve_->getCa( e.id() );
60 }
61 
62 void ZombieCaConc::vSetCaBasal( const Eref& e , double CaBasal )
63 {
64  hsolve_->setCa( e.id(), CaBasal );
65 }
66 
67 double ZombieCaConc::vGetCaBasal( const Eref& e ) const
68 {
69  return hsolve_->getCaBasal( e.id() );
70 }
71 
72 void ZombieCaConc::vSetTau( const Eref& e , double tau )
73 {
74  tau_ = tau;
75  hsolve_->setTauB( e.id(), tau_, B_ );
76 }
77 
78 double ZombieCaConc::vGetTau( const Eref& e ) const
79 {
80  return tau_;
81 }
82 
83 void ZombieCaConc::vSetB( const Eref& e , double B )
84 {
85  B_ = B;
86  hsolve_->setTauB( e.id(), tau_, B_ );
87 }
88 
89 double ZombieCaConc::vGetB( const Eref& e ) const
90 {
91  return B_;
92 }
93 
94 void ZombieCaConc::vSetCeiling( const Eref& e , double ceiling )
95 {
96  hsolve_->setCaCeiling( e.id(), ceiling );
97 }
98 
99 double ZombieCaConc::vGetCeiling( const Eref& e ) const
100 {
101  return hsolve_->getCaCeiling( e.id() );
102 }
103 
104 void ZombieCaConc::vSetFloor( const Eref& e , double floor )
105 {
106  hsolve_->setCaFloor( e.id(), floor );
107 }
108 
109 double ZombieCaConc::vGetFloor( const Eref& e ) const
110 {
111  return hsolve_->getCaFloor( e.id() );
112 }
113 
115 // Dest function definitions
117 
118 void ZombieCaConc::vReinit( const Eref& e, ProcPtr p )
119 {
120  ;
121 }
122 
124 {
125  ;
126 }
127 
128 void ZombieCaConc::vCurrent( const Eref& e, double I )
129 {
130  //~ activation_ += I;
131  hsolve_->iCa( e.id(), I );
132 }
133 
134 void ZombieCaConc::vCurrentFraction( const Eref& e, double I, double fraction )
135 {
136  //~ activation_ += I * fraction;
137 }
138 
139 void ZombieCaConc::vIncrease( const Eref& e, double I )
140 {
141  //~ activation_ += fabs( I );
142 }
143 
144 void ZombieCaConc::vDecrease( const Eref& e, double I )
145 {
146  //~ activation_ -= fabs( I );
147 }
148 
150 void ZombieCaConc::vSetSolver( const Eref& e, Id hsolve )
151 {
152  if ( !hsolve.element()->cinfo()->isA( "HSolve" ) ) {
153  cout << "Error: ZombieCaConc::vSetSolver: Object: " <<
154  hsolve.path() << " is not an HSolve. Aborted\n";
155  hsolve_ = 0;
156  return;
157  }
158  hsolve_ = reinterpret_cast< HSolve* >( hsolve.eref().data() );
159 }
double getCaFloor(Id id) const
Id id() const
Definition: Eref.cpp:62
void setCa(Id id, double Ca)
char * data() const
Definition: Eref.cpp:41
void setTauB(Id id, double tau, double B)
void vIncrease(const Eref &e, double I)
void vSetSolver(const Eref &e, Id hsolve)
Used to set up the solver. Dummy for regular classes.
void vCurrentFraction(const Eref &e, double I, double fraction)
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
void vSetCeiling(const Eref &e, double val)
std::string path(const std::string &separator="/") const
Definition: Id.cpp:76
void setCaCeiling(Id id, double floor)
Definition: Dinfo.h:60
void vSetCaBasal(const Eref &e, double val)
void vSetTau(const Eref &e, double val)
double getCaBasal(Id id) const
void vReinit(const Eref &e, ProcPtr info)
static const Cinfo * initCinfo()
void vSetB(const Eref &e, double val)
Eref eref() const
Definition: Id.cpp:125
void vSetFloor(const Eref &e, double val)
double vGetTau(const Eref &e) const
void setCaFloor(Id id, double floor)
HSolve * hsolve_
Definition: ZombieCaConc.h:63
void vSetCa(const Eref &e, double val)
double vGetB(const Eref &e) const
Definition: HSolve.h:16
Definition: Eref.h:26
bool isA(const string &ancestor) const
Definition: Cinfo.cpp:280
const Cinfo * cinfo() const
Definition: Element.cpp:66
static const Cinfo * initCinfo()
Definition: CaConcBase.cpp:31
void vDecrease(const Eref &e, double I)
double vGetCeiling(const Eref &e) const
void iCa(Id id, double iCa)
void vCurrent(const Eref &e, double I)
Definition: Id.h:17
static const Cinfo * zombieCaConcCinfo
double getCaCeiling(Id id) const
double vGetFloor(const Eref &e) const
double vGetCaBasal(const Eref &e) const
double vGetCa(const Eref &e) const
Definition: Cinfo.h:18
double getCa(Id id) const
Interface to CaConc.
void vProcess(const Eref &e, ProcPtr info)