MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Nernst Class Reference

#include <Nernst.h>

+ Collaboration diagram for Nernst:

Public Member Functions

double getCin () const
 
double getCout () const
 
double getE () const
 
double getScale () const
 
double getTemperature () const
 
int getValence () const
 
void handleCin (const Eref &e, double conc)
 
void handleCout (const Eref &e, double conc)
 
 Nernst ()
 
void setCin (double value)
 
void setCout (double value)
 
void setScale (double value)
 
void setTemperature (double value)
 
void setValence (int value)
 

Static Public Member Functions

static const CinfoinitCinfo ()
 

Private Member Functions

void updateE ()
 

Private Attributes

double Cin_
 
double Cout_
 
double E_
 
double factor_
 
double scale_
 
double Temperature_
 
int valence_
 

Static Private Attributes

static const double R_OVER_F = 8.6171458e-5
 
static const double ZERO_CELSIUS = 273.15
 

Detailed Description

This class does the Nernst equation calculations

Definition at line 16 of file Nernst.h.

Constructor & Destructor Documentation

Nernst::Nernst ( )

Definition at line 118 of file Nernst.cpp.

119  :
120  E_( 0.0 ),
121  Temperature_( 295 ),
122  valence_( 1 ),
123  Cin_( 1.0 ),
124  Cout_( 1.0 ),
125  scale_( 1.0 ),
127 {;}
double Cout_
Definition: Nernst.h:55
int valence_
Definition: Nernst.h:53
double Temperature_
Definition: Nernst.h:52
double factor_
Definition: Nernst.h:57
double E_
Definition: Nernst.h:51
double Cin_
Definition: Nernst.h:54
static const double R_OVER_F
Definition: Nernst.h:58
double scale_
Definition: Nernst.h:56

Member Function Documentation

double Nernst::getCin ( ) const

Definition at line 168 of file Nernst.cpp.

References Cin_.

Referenced by initCinfo().

169 {
170  return Cin_;
171 }
double Cin_
Definition: Nernst.h:54

+ Here is the caller graph for this function:

double Nernst::getCout ( ) const

Definition at line 177 of file Nernst.cpp.

References Cout_.

Referenced by initCinfo().

178 {
179  return Cout_;
180 }
double Cout_
Definition: Nernst.h:55

+ Here is the caller graph for this function:

double Nernst::getE ( ) const

Definition at line 132 of file Nernst.cpp.

References E_.

Referenced by initCinfo().

133 {
134  return E_;
135 }
double E_
Definition: Nernst.h:51

+ Here is the caller graph for this function:

double Nernst::getScale ( ) const

Definition at line 187 of file Nernst.cpp.

References scale_.

Referenced by initCinfo().

188 {
189  return scale_;
190 }
double scale_
Definition: Nernst.h:56

+ Here is the caller graph for this function:

double Nernst::getTemperature ( ) const

Definition at line 145 of file Nernst.cpp.

References Temperature_.

Referenced by initCinfo().

146 {
147  return Temperature_;
148 }
double Temperature_
Definition: Nernst.h:52

+ Here is the caller graph for this function:

int Nernst::getValence ( ) const

Definition at line 158 of file Nernst.cpp.

References valence_.

Referenced by initCinfo().

159 {
160  return valence_;
161 }
int valence_
Definition: Nernst.h:53

+ Here is the caller graph for this function:

void Nernst::handleCin ( const Eref e,
double  conc 
)

Definition at line 201 of file Nernst.cpp.

References Cin_, E_, Eout(), and updateE().

Referenced by initCinfo().

202 {
203  Cin_ = conc;
204  updateE();
205  Eout()->send( er, E_ );
206 }
static SrcFinfo1< double > * Eout()
Definition: Nernst.cpp:19
double E_
Definition: Nernst.h:51
double Cin_
Definition: Nernst.h:54
void updateE()
Definition: Nernst.cpp:196

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Nernst::handleCout ( const Eref e,
double  conc 
)

Definition at line 208 of file Nernst.cpp.

References Cout_, E_, Eout(), and updateE().

Referenced by initCinfo().

209 {
210  Cout_ = conc;
211  updateE();
212  Eout()->send( er, E_ );
213 }
double Cout_
Definition: Nernst.h:55
static SrcFinfo1< double > * Eout()
Definition: Nernst.cpp:19
double E_
Definition: Nernst.h:51
void updateE()
Definition: Nernst.cpp:196

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Cinfo * Nernst::initCinfo ( )
static

Definition at line 26 of file Nernst.cpp.

References Eout(), getCin(), getCout(), getE(), getScale(), getTemperature(), getValence(), handleCin(), handleCout(), Neutral::initCinfo(), setCin(), setCout(), setScale(), setTemperature(), and setValence().

27 {
29  "Computed reversal potential",
31  );
32  static ValueFinfo< Nernst, double > temperature( "Temperature",
33  "Temperature of cell",
36  );
37  static ValueFinfo< Nernst, int > valence( "valence",
38  "Valence of ion in Nernst calculation",
41  );
42  static ValueFinfo< Nernst, double > Cin( "Cin",
43  "Internal conc of ion",
46  );
47  static ValueFinfo< Nernst, double > Cout( "Cout",
48  "External conc of ion",
51  );
52  static ValueFinfo< Nernst, double > scale( "scale",
53  "Voltage scale factor",
56  );
58  // Shared definitions
60 
61 
63  // MsgDest definitions
64  // These differ from field assignments because they trigger an
65  // outgoing msg with the updated E.
67  static DestFinfo ci( "ci",
68  "Set internal conc of ion, and immediately send out the updated E",
70  );
71  static DestFinfo co( "co",
72  "Set external conc of ion, and immediately send out the updated E",
74  );
75 
77  // Field definitions
79  static Finfo* NernstFinfos[] =
80  {
81  Eout(), // SrcFinfo
82  &E, // ReadOnlyValue
83  &temperature, // Value
84  &valence, // Value
85  &Cin, // Value
86  &Cout, // Value
87  &scale, // Value
88  &ci, // Dest
89  &co, // Dest
90  };
91 
92  static string doc[] =
93  {
94  "Name", "Nernst",
95  "Author", "Upinder S. Bhalla, 2007, NCBS",
96  "Description", "Nernst: Calculates Nernst potential for a given ion based on "
97  "Cin and Cout, the inside and outside concentrations. "
98  "Immediately sends out the potential to all targets.",
99  };
100 
101  static Dinfo< Nernst > dinfo;
102  static const Cinfo NernstCinfo(
103  "Nernst",
105  NernstFinfos,
106  sizeof( NernstFinfos ) / sizeof(Finfo *),
107  &dinfo,
108  doc,
109  sizeof( doc ) / sizeof( string )
110  );
111 
112  return &NernstCinfo;
113 }
double getCin() const
Definition: Nernst.cpp:168
void setTemperature(double value)
Definition: Nernst.cpp:137
Definition: Dinfo.h:60
Definition: EpFunc.h:64
void setCout(double value)
Definition: Nernst.cpp:173
void setScale(double value)
Definition: Nernst.cpp:182
double getE() const
Definition: Nernst.cpp:132
void setValence(int value)
Definition: Nernst.cpp:150
void setCin(double value)
Definition: Nernst.cpp:163
void handleCout(const Eref &e, double conc)
Definition: Nernst.cpp:208
static SrcFinfo1< double > * Eout()
Definition: Nernst.cpp:19
double getTemperature() const
Definition: Nernst.cpp:145
double getCout() const
Definition: Nernst.cpp:177
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
double getScale() const
Definition: Nernst.cpp:187
int getValence() const
Definition: Nernst.cpp:158
void handleCin(const Eref &e, double conc)
Definition: Nernst.cpp:201
Definition: Cinfo.h:18
Definition: Finfo.h:12

+ Here is the call graph for this function:

void Nernst::setCin ( double  value)

Definition at line 163 of file Nernst.cpp.

References Cin_, updateE(), and value.

Referenced by initCinfo().

164 {
165  Cin_ = value;
166  updateE();
167 }
uint32_t value
Definition: moosemodule.h:42
double Cin_
Definition: Nernst.h:54
void updateE()
Definition: Nernst.cpp:196

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Nernst::setCout ( double  value)

Definition at line 173 of file Nernst.cpp.

References Cout_, updateE(), and value.

Referenced by initCinfo().

173  {
174  Cout_ = value;
175  updateE();
176 }
uint32_t value
Definition: moosemodule.h:42
double Cout_
Definition: Nernst.h:55
void updateE()
Definition: Nernst.cpp:196

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Nernst::setScale ( double  value)

Definition at line 182 of file Nernst.cpp.

References factor_, R_OVER_F, scale_, Temperature_, updateE(), valence_, and value.

Referenced by initCinfo().

182  {
183  scale_ = value;
185  updateE();
186 }
uint32_t value
Definition: moosemodule.h:42
int valence_
Definition: Nernst.h:53
double Temperature_
Definition: Nernst.h:52
double factor_
Definition: Nernst.h:57
static const double R_OVER_F
Definition: Nernst.h:58
double scale_
Definition: Nernst.h:56
void updateE()
Definition: Nernst.cpp:196

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Nernst::setTemperature ( double  value)

Definition at line 137 of file Nernst.cpp.

References factor_, R_OVER_F, scale_, Temperature_, updateE(), valence_, and value.

Referenced by initCinfo().

137  {
138  if ( value > 0.0 ) {
141  }
142  updateE();
143 }
uint32_t value
Definition: moosemodule.h:42
int valence_
Definition: Nernst.h:53
double Temperature_
Definition: Nernst.h:52
double factor_
Definition: Nernst.h:57
static const double R_OVER_F
Definition: Nernst.h:58
double scale_
Definition: Nernst.h:56
void updateE()
Definition: Nernst.cpp:196

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Nernst::setValence ( int  value)

Definition at line 150 of file Nernst.cpp.

References factor_, R_OVER_F, scale_, Temperature_, updateE(), valence_, and value.

Referenced by initCinfo().

150  {
151  if ( value != 0 ) {
152  valence_ = value;
153  }
155  updateE();
156 }
uint32_t value
Definition: moosemodule.h:42
int valence_
Definition: Nernst.h:53
double Temperature_
Definition: Nernst.h:52
double factor_
Definition: Nernst.h:57
static const double R_OVER_F
Definition: Nernst.h:58
double scale_
Definition: Nernst.h:56
void updateE()
Definition: Nernst.cpp:196

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Nernst::updateE ( )
private

Definition at line 196 of file Nernst.cpp.

References Cin_, Cout_, E_, factor_, and moose::log().

Referenced by handleCin(), handleCout(), setCin(), setCout(), setScale(), setTemperature(), and setValence().

197 {
198  E_ = factor_ * log( Cout_ / Cin_ );
199 }
double Cout_
Definition: Nernst.h:55
void log(string msg, serverity_level_ type=debug, bool redirectToConsole=true, bool removeTicks=true)
Log to console (and to a log-file)
double factor_
Definition: Nernst.h:57
double E_
Definition: Nernst.h:51
double Cin_
Definition: Nernst.h:54

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

double Nernst::Cin_
private

Definition at line 54 of file Nernst.h.

Referenced by getCin(), handleCin(), setCin(), and updateE().

double Nernst::Cout_
private

Definition at line 55 of file Nernst.h.

Referenced by getCout(), handleCout(), setCout(), and updateE().

double Nernst::E_
private

Definition at line 51 of file Nernst.h.

Referenced by getE(), handleCin(), handleCout(), and updateE().

double Nernst::factor_
private

Definition at line 57 of file Nernst.h.

Referenced by setScale(), setTemperature(), setValence(), and updateE().

const double Nernst::R_OVER_F = 8.6171458e-5
staticprivate

Definition at line 58 of file Nernst.h.

Referenced by setScale(), setTemperature(), and setValence().

double Nernst::scale_
private

Definition at line 56 of file Nernst.h.

Referenced by getScale(), setScale(), setTemperature(), and setValence().

double Nernst::Temperature_
private

Definition at line 52 of file Nernst.h.

Referenced by getTemperature(), setScale(), setTemperature(), and setValence().

int Nernst::valence_
private

Definition at line 53 of file Nernst.h.

Referenced by getValence(), setScale(), setTemperature(), and setValence().

const double Nernst::ZERO_CELSIUS = 273.15
staticprivate

Definition at line 59 of file Nernst.h.


The documentation for this class was generated from the following files: