Nektar++
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types | Private Attributes | Static Private Attributes | List of all members
Nektar::FentonKarma Class Reference

#include <FentonKarma.h>

Inheritance diagram for Nektar::FentonKarma:
[legend]

Public Member Functions

 FentonKarma (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
 Constructor. More...
 
virtual ~FentonKarma ()
 Destructor. More...
 
- Public Member Functions inherited from Nektar::CellModel
 CellModel (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
 
virtual ~CellModel ()
 
void Initialise ()
 Initialise the cell model storage and set initial conditions. More...
 
void TimeIntegrate (const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
 Time integrate the cell model by one PDE timestep. More...
 
void Update (const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
 Compute the derivatives of cell model variables. More...
 
void GenerateSummary (SummaryList &s)
 Print a summary of the cell model. More...
 
size_t GetNumCellVariables ()
 
std::string GetCellVarName (size_t idx)
 
Array< OneD, NekDoubleGetCellSolutionCoeffs (size_t idx)
 
Array< OneD, NekDoubleGetCellSolution (size_t idx)
 

Static Public Member Functions

static CellModelSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
 Creates an instance of this class. More...
 

Static Public Attributes

static std::string className
 Name of class. More...
 

Protected Member Functions

virtual void v_Update (const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time) override
 Computes the reaction terms $f(u,v)$ and $g(u,v)$. More...
 
virtual void v_GenerateSummary (SummaryList &s) override
 Prints a summary of the model parameters. More...
 
virtual void v_SetInitialConditions () override
 
virtual std::string v_GetCellVarName (size_t idx) override
 
- Protected Member Functions inherited from Nektar::CellModel
void LoadCellModel ()
 

Private Types

enum  Variants {
  eBR , eMBR , eMLR1 , eGP ,
  eCF1 , eCF2a , eCF2b , eCF2c ,
  eCF3a , eCF3b , eFC2002Set1a , eFC2002Set1b ,
  eFC2002Set1c , eFC2002Set1d , eFC2002Set1e , eFC2002Set2 ,
  eFC2002Set4a , eFC2002Set4b , eFC2002Set4c , eFC2002Set4d ,
  eFC2002Set5 , eFC2002Set6 , eFC2002Set7 , eFC2002Set8 ,
  eFC2002Set9 , eLawson , eCAF
}
 

Private Attributes

NekDouble C_m
 
NekDouble V_0
 
NekDouble V_fi
 
NekDouble u_fi
 
NekDouble u_c
 
NekDouble u_v
 
NekDouble u_r
 
NekDouble g_fi_max
 
NekDouble tau_d
 
NekDouble tau_v1_minus
 
NekDouble tau_v2_minus
 
NekDouble tau_v_plus
 
NekDouble tau_0
 
NekDouble tau_r
 
NekDouble tau_si
 
NekDouble tau_y_plus
 
NekDouble tau_y_minus
 
NekDouble u_csi
 
NekDouble k1
 
NekDouble k2
 
NekDouble tau_w_minus
 
NekDouble tau_w_plus
 
bool isCF3
 
enum Variants model_variant
 

Static Private Attributes

static std::string lookupIds []
 
static std::string def
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::CellModel
LibUtilities::SessionReaderSharedPtr m_session
 Session. More...
 
MultiRegions::ExpListSharedPtr m_field
 Transmembrane potential field from PDE system. More...
 
size_t m_nq
 Number of physical points. More...
 
size_t m_nvar
 Number of variables in cell model (inc. transmembrane voltage) More...
 
NekDouble m_lastTime
 Timestep for pde model. More...
 
size_t m_substeps
 Number of substeps to take. More...
 
Array< OneD, Array< OneD, NekDouble > > m_cellSol
 Cell model solution variables. More...
 
Array< OneD, Array< OneD, NekDouble > > m_wsp
 Cell model integration workspace. More...
 
bool m_useNodal
 Flag indicating whether nodal projection in use. More...
 
StdRegions::StdNodalTriExpSharedPtr m_nodalTri
 StdNodalTri for cell model calculations. More...
 
StdRegions::StdNodalTetExpSharedPtr m_nodalTet
 
Array< OneD, Array< OneD, NekDouble > > m_nodalTmp
 Temporary array for nodal projection. More...
 
std::vector< int > m_concentrations
 Indices of cell model variables which are concentrations. More...
 
std::vector< int > m_gates
 Indices of cell model variables which are gates. More...
 
Array< OneD, Array< OneD, NekDouble > > m_gates_tau
 Storage for gate tau values. More...
 

Detailed Description

Definition at line 42 of file FentonKarma.h.

Member Enumeration Documentation

◆ Variants

Enumerator
eBR 
eMBR 
eMLR1 
eGP 
eCF1 
eCF2a 
eCF2b 
eCF2c 
eCF3a 
eCF3b 
eFC2002Set1a 
eFC2002Set1b 
eFC2002Set1c 
eFC2002Set1d 
eFC2002Set1e 
eFC2002Set2 
eFC2002Set4a 
eFC2002Set4b 
eFC2002Set4c 
eFC2002Set4d 
eFC2002Set5 
eFC2002Set6 
eFC2002Set7 
eFC2002Set8 
eFC2002Set9 
eLawson 
eCAF 

Definition at line 103 of file FentonKarma.h.

104  {
105  eBR,
106  eMBR,
107  eMLR1,
108  eGP,
109  eCF1,
110  eCF2a,
111  eCF2b,
112  eCF2c,
113  eCF3a,
114  eCF3b,
115  eFC2002Set1a,
116  eFC2002Set1b,
117  eFC2002Set1c,
118  eFC2002Set1d,
119  eFC2002Set1e,
120  eFC2002Set2,
121  eFC2002Set4a,
122  eFC2002Set4b,
123  eFC2002Set4c,
124  eFC2002Set4d,
125  eFC2002Set5,
126  eFC2002Set6,
127  eFC2002Set7,
128  eFC2002Set8,
129  eFC2002Set9,
130  eLawson,
131  eCAF
132  };

Constructor & Destructor Documentation

◆ FentonKarma()

Nektar::FentonKarma::FentonKarma ( const LibUtilities::SessionReaderSharedPtr pSession,
const MultiRegions::ExpListSharedPtr pField 
)

Constructor.

Initialise Fenton-Karma model parameters. k1 is k in the original model. k2 is an additional parameter introduced in Cherry&Fenton 2004. u_r and u_fi are introduced by Cherry&Fenton 2004 and is the same as u_c in the original model.

Definition at line 122 of file FentonKarma.cpp.

124  : CellModel(pSession, pField)
125 {
126  model_variant = pSession->GetSolverInfoAsEnum<FentonKarma::Variants>(
127  "CellModelVariant");
128 
129  C_m = 1; // picoF
130  V_0 = -85;
131  V_fi = 15;
132 
133  switch (model_variant)
134  {
135  case eBR: // (Fenton, Karma, Chaos 8(1), 1998)
136  g_fi_max = 4;
137  tau_r = 33.33;
138  tau_si = 29;
139  tau_0 = 12.5;
140  tau_v_plus = 3.33;
141  tau_v1_minus = 1250;
142  tau_v2_minus = 19.6;
143  tau_w_plus = 870;
144  tau_w_minus = 41;
145  u_c = 0.13;
146  u_v = 0.04;
147  u_r = 0.13;
148  u_fi = 0.13;
149  u_csi = 0.85;
150  k1 = 10;
151  k2 = 0.0;
152  break;
153  case eMBR: // (Fenton, Karma, Chaos 8(1), 1998)
154  g_fi_max = 4;
155  tau_r = 50;
156  tau_si = 44.84;
157  tau_0 = 8.3;
158  tau_v_plus = 3.33;
159  tau_v1_minus = 1000;
160  tau_v2_minus = 19.2;
161  tau_w_plus = 667;
162  tau_w_minus = 11;
163  u_c = 0.13;
164  u_v = 0.04;
165  u_r = 0.13;
166  u_fi = 0.13;
167  u_csi = 0.85;
168  k1 = 10;
169  k2 = 0.0;
170  break;
171  case eMLR1: // (Fenton, Karma, Chaos 8(1), 1998)
172  g_fi_max = 5.8;
173  tau_r = 130;
174  tau_si = 127;
175  tau_0 = 12.5;
176  tau_v_plus = 10;
177  tau_v1_minus = 18.2;
178  tau_v2_minus = 18.2;
179  tau_w_plus = 1020;
180  tau_w_minus = 80;
181  u_c = 0.13;
182  u_v = 0.0;
183  u_r = 0.13;
184  u_fi = 0.13;
185  u_csi = 0.85;
186  k1 = 10;
187  k2 = 0.0;
188  break;
189  case eGP: // (Fenton, Karma, Chaos 8(1), 1998)
190  g_fi_max = 8.7;
191  tau_r = 25;
192  tau_si = 22.22;
193  tau_0 = 12.5;
194  tau_v_plus = 10;
195  tau_v1_minus = 333;
196  tau_v2_minus = 40;
197  tau_w_plus = 1000;
198  tau_w_minus = 65;
199  u_c = 0.13;
200  u_v = 0.025;
201  u_r = 0.13;
202  u_fi = 0.13;
203  u_csi = 0.85;
204  k1 = 10;
205  k2 = 0.0;
206  break;
207  case eCF1: // (Cherry, Fenton, Am J Physiol Heart 286, 2004)
208  g_fi_max = 6.6666;
209  tau_r = 12.5;
210  tau_si = 10;
211  tau_0 = 1.5;
212  tau_v_plus = 10;
213  tau_v1_minus = 350;
214  tau_v2_minus = 80;
215  tau_w_plus = 562;
216  tau_w_minus = 48.5;
217  u_c = 0.25;
218  u_v = 0.001;
219  u_r = 0.25;
220  u_fi = 0.15;
221  u_csi = 0.2;
222  k1 = 15;
223  k2 = 0;
224  break;
225  case eCF2a: // (Cherry, Fenton, Am J Physiol Heart 286, 2004)
226  g_fi_max = 6.6666;
227  tau_r = 31;
228  tau_si = 26.5;
229  tau_0 = 1.5;
230  tau_v_plus = 10;
231  tau_v1_minus = 20;
232  tau_v2_minus = 20;
233  tau_w_plus = 800;
234  tau_w_minus = 45;
235  u_c = 0.25;
236  u_v = 0.05;
237  u_r = 0.6;
238  u_fi = 0.11;
239  u_csi = 0.7;
240  k1 = 10;
241  k2 = 1;
242  break;
243  case eCF2b: // (Cherry, Fenton, Am J Physiol Heart 286, 2004)
244  g_fi_max = 6.6666;
245  tau_r = 31;
246  tau_si = 26.5;
247  tau_0 = 1.5;
248  tau_v_plus = 10;
249  tau_v1_minus = 100;
250  tau_v2_minus = 20;
251  tau_w_plus = 800;
252  tau_w_minus = 45;
253  u_c = 0.25;
254  u_v = 0.05;
255  u_r = 0.6;
256  u_fi = 0.11;
257  u_csi = 0.7;
258  k1 = 10;
259  k2 = 1;
260  break;
261  case eCF2c: // (Cherry, Fenton, Am J Physiol Heart 286, 2004)
262  g_fi_max = 6.6666;
263  tau_r = 31;
264  tau_si = 26.5;
265  tau_0 = 1.5;
266  tau_v_plus = 10;
267  tau_v1_minus = 150;
268  tau_v2_minus = 20;
269  tau_w_plus = 800;
270  tau_w_minus = 45;
271  u_c = 0.25;
272  u_v = 0.05;
273  u_r = 0.6;
274  u_fi = 0.11;
275  u_csi = 0.7;
276  k1 = 10;
277  k2 = 1;
278  break;
279  case eCF3a: // (Cherry, Fenton, Am J Physiol Heart 286, 2004)
280  g_fi_max = 13.3333;
281  tau_r = 38;
282  tau_si = 127;
283  tau_0 = 8.3;
284  tau_v_plus = 3.33;
285  tau_v1_minus = 45;
286  tau_v2_minus = 300;
287  tau_w_plus = 600;
288  tau_w_minus = 40;
289  tau_y_plus = 1000;
290  tau_y_minus = 230;
291  u_c = 0.25;
292  u_v = 0.5;
293  u_r = 0.25;
294  u_fi = 0.25;
295  u_csi = 0.7;
296  k1 = 60;
297  k2 = 0;
298  break;
299  case eCF3b: // (Cherry, Fenton, Am J Physiol Heart 286, 2004)
300  g_fi_max = 13.3333;
301  tau_r = 38;
302  tau_si = 127;
303  tau_0 = 8.3;
304  tau_v_plus = 3.33;
305  tau_v1_minus = 20;
306  tau_v2_minus = 300;
307  tau_w_plus = 600;
308  tau_w_minus = 40;
309  tau_y_plus = 1000;
310  tau_y_minus = 230;
311  u_c = 0.25;
312  u_v = 0.5;
313  u_r = 0.25;
314  u_fi = 0.25;
315  u_csi = 0.7;
316  k1 = 60;
317  k2 = 0;
318  break;
319  case eFC2002Set1a: // (Fenton, Cherry, Chaos 12(852), 2002)
320  g_fi_max = 1 / 0.41; // 2.44 - Fig 1A
321  tau_r = 50;
322  tau_si = 45;
323  tau_0 = 1 / 0.12; // 8.33
324  tau_v_plus = 3.33;
325  tau_v1_minus = 1000;
326  tau_v2_minus = 19.6;
327  tau_w_plus = 667;
328  tau_w_minus = 11;
329  u_c = 0.13;
330  u_v = 0.055;
331  u_r = u_c;
332  u_fi = u_c;
333  u_csi = 0.85;
334  k1 = 10;
335  k2 = 0;
336  break;
337  case eFC2002Set1b: // (Fenton, Cherry, Chaos 12(852), 2002)
338  g_fi_max = 1 / 0.392; // 2.55 - Fig 1B
339  tau_r = 50;
340  tau_si = 45;
341  tau_0 = 1 / 0.12; // 8.33
342  tau_v_plus = 3.33;
343  tau_v1_minus = 1000;
344  tau_v2_minus = 19.6;
345  tau_w_plus = 667;
346  tau_w_minus = 11;
347  u_c = 0.13;
348  u_v = 0.055;
349  u_r = u_c;
350  u_fi = u_c;
351  u_csi = 0.85;
352  k1 = 10;
353  k2 = 0;
354  break;
355  case eFC2002Set1c: // (Fenton, Cherry, Chaos 12(852), 2002)
356  g_fi_max = 1 / 0.381; // 2.62 - Fig 1C
357  tau_r = 50;
358  tau_si = 45;
359  tau_0 = 1 / 0.12; // 8.33
360  tau_v_plus = 3.33;
361  tau_v1_minus = 1000;
362  tau_v2_minus = 19.6;
363  tau_w_plus = 667;
364  tau_w_minus = 11;
365  u_c = 0.13;
366  u_v = 0.055;
367  u_r = u_c;
368  u_fi = u_c;
369  u_csi = 0.85;
370  k1 = 10;
371  k2 = 0;
372  break;
373  case eFC2002Set1d: // (Fenton, Cherry, Chaos 12(852), 2002)
374  g_fi_max = 1 / 0.36; // 2.77 - Fig 1D
375  tau_r = 50;
376  tau_si = 45;
377  tau_0 = 1 / 0.12; // 8.33
378  tau_v_plus = 3.33;
379  tau_v1_minus = 1000;
380  tau_v2_minus = 19.6;
381  tau_w_plus = 667;
382  tau_w_minus = 11;
383  u_c = 0.13;
384  u_v = 0.055;
385  u_r = u_c;
386  u_fi = u_c;
387  u_csi = 0.85;
388  k1 = 10;
389  k2 = 0;
390  break;
391  case eFC2002Set1e: // (Fenton, Cherry, Chaos 12(852), 2002)
392  g_fi_max = 1 / 0.25; // 4 - Fig 1E
393  tau_r = 50;
394  tau_si = 45;
395  tau_0 = 1 / 0.12; // 8.33
396  tau_v_plus = 3.33;
397  tau_v1_minus = 1000;
398  tau_v2_minus = 19.6;
399  tau_w_plus = 667;
400  tau_w_minus = 11;
401  u_c = 0.13;
402  u_v = 0.055;
403  u_r = u_c;
404  u_fi = u_c;
405  u_csi = 0.85;
406  k1 = 10;
407  k2 = 0;
408  break;
409  case eFC2002Set2: // (Fenton, Cherry, Chaos 12(852), 2002)
410  g_fi_max = 4;
411  tau_r = 190;
412  tau_si = 100000;
413  tau_0 = 10;
414  tau_v_plus = 10;
415  tau_v1_minus = 10;
416  tau_v2_minus = 10;
417  tau_w_plus = 100000;
418  tau_w_minus = 100000;
419  u_c = 0.13;
420  u_v = 100;
421  u_r = u_c;
422  u_fi = u_c;
423  u_csi = 100;
424  k1 = 10;
425  k2 = 0;
426  break;
427  case eFC2002Set4a: // (Fenton, Cherry, Chaos 12(852), 2002)
428  g_fi_max = 1.0 / 0.407;
429  tau_r = 34;
430  tau_si = 26.5;
431  tau_0 = 9;
432  tau_v_plus = 3.33;
433  tau_v1_minus = 5; // Opposite convention
434  tau_v2_minus = 15.6; // to the paper
435  tau_w_plus = 350;
436  tau_w_minus = 80;
437  u_c = 0.15;
438  u_v = 0.04;
439  u_r = u_c;
440  u_fi = u_c;
441  u_csi = 0.45;
442  k1 = 15;
443  k2 = 0;
444  break;
445  case eFC2002Set4b: // (Fenton, Cherry, Chaos 12(852), 2002)
446  g_fi_max = 1.0 / 0.41;
447  tau_r = 34;
448  tau_si = 26.5;
449  tau_0 = 9;
450  tau_v_plus = 3.33;
451  tau_v1_minus = 5; // Opposite convention
452  tau_v2_minus = 15.6; // to the paper
453  tau_w_plus = 350;
454  tau_w_minus = 80;
455  u_c = 0.15;
456  u_v = 0.04;
457  u_r = u_c;
458  u_fi = u_c;
459  u_csi = 0.45;
460  k1 = 15;
461  k2 = 0;
462  break;
463  case eFC2002Set4c: // (Fenton, Cherry, Chaos 12(852), 2002)
464  g_fi_max = 1.0 / 0.405;
465  tau_r = 34;
466  tau_si = 26.5;
467  tau_0 = 9;
468  tau_v_plus = 3.33;
469  tau_v1_minus = 5; // Opposite convention
470  tau_v2_minus = 15.6; // to the paper
471  tau_w_plus = 350;
472  tau_w_minus = 80;
473  u_c = 0.15;
474  u_v = 0.04;
475  u_r = u_c;
476  u_fi = u_c;
477  u_csi = 0.45;
478  k1 = 15;
479  k2 = 0;
480  break;
481  case eFC2002Set4d: // (Fenton, Cherry, Chaos 12(852), 2002)
482  g_fi_max = 1.0 / 0.4;
483  tau_r = 34;
484  tau_si = 26.5;
485  tau_0 = 9;
486  tau_v_plus = 3.33;
487  tau_v1_minus = 5; // Opposite convention
488  tau_v2_minus = 15.6; // to the paper
489  tau_w_plus = 350;
490  tau_w_minus = 80;
491  u_c = 0.15;
492  u_v = 0.04;
493  u_r = u_c;
494  u_fi = u_c;
495  u_csi = 0.45;
496  k1 = 15;
497  k2 = 0;
498  break;
499  case eFC2002Set5: // (Fenton, Cherry, Chaos 12(852), 2002)
500  g_fi_max = 2.76;
501  tau_r = 33.33;
502  tau_si = 29;
503  tau_0 = 5;
504  tau_v_plus = 3.33;
505  tau_v1_minus = 2; // Opposite convention
506  tau_v2_minus = 12; // to the paper
507  tau_w_plus = 1000;
508  tau_w_minus = 100;
509  u_c = 0.13;
510  u_v = 0.14;
511  u_r = u_c;
512  u_fi = u_c;
513  u_csi = 0.70;
514  k1 = 15;
515  k2 = 0;
516  break;
517  case eFC2002Set6: // (Fenton, Cherry, Chaos 12(852), 2002)
518  g_fi_max = 2.53;
519  tau_r = 33.33;
520  tau_si = 29;
521  tau_0 = 9;
522  tau_v_plus = 3.33;
523  tau_v1_minus = 8; // Opposite convention
524  tau_v2_minus = 9; // to the paper
525  tau_w_plus = 250;
526  tau_w_minus = 60;
527  u_c = 0.13;
528  u_v = 0.04;
529  u_r = u_c;
530  u_fi = u_c;
531  u_csi = 0.50;
532  k1 = 15;
533  k2 = 0;
534  break;
535  case eFC2002Set7: // (Fenton, Cherry, Chaos 12(852), 2002)
536  g_fi_max = 4;
537  tau_r = 100;
538  tau_si = 100000;
539  tau_0 = 12;
540  tau_v_plus = 10;
541  tau_v1_minus = 7; // Opposite convention
542  tau_v2_minus = 7; // to the paper
543  tau_w_plus = 100000;
544  tau_w_minus = 100000;
545  u_c = 0.13;
546  u_v = 100;
547  u_r = u_c;
548  u_fi = u_c;
549  u_csi = 100;
550  k1 = 10;
551  k2 = 0;
552  break;
553  case eFC2002Set8: // (Fenton, Cherry, Chaos 12(852), 2002)
554  g_fi_max = 2.2;
555  tau_r = 33.25;
556  tau_si = 29;
557  tau_0 = 12.5;
558  tau_v_plus = 13.03;
559  tau_v1_minus = 1250; // Opposite convention
560  tau_v2_minus = 19.6; // to the paper
561  tau_w_plus = 800;
562  tau_w_minus = 40;
563  u_c = 0.13;
564  u_v = 0.04;
565  u_r = u_c;
566  u_fi = u_c;
567  u_csi = 0.85;
568  k1 = 10;
569  k2 = 0;
570  break;
571  case eFC2002Set9: // (Fenton, Cherry, Chaos 12(852), 2002)
572  g_fi_max = 4;
573  tau_r = 28;
574  tau_si = 29;
575  tau_0 = 12.5;
576  tau_v_plus = 3.33;
577  tau_v1_minus = 2; // Opposite convention
578  tau_v2_minus = 15; // to the paper
579  tau_w_plus = 670;
580  tau_w_minus = 61;
581  u_c = 0.13;
582  u_v = 0.05;
583  u_r = u_c;
584  u_fi = u_c;
585  u_csi = 0.45;
586  k1 = 10;
587  k2 = 0;
588  break;
589  case eLawson: // (Lawson, Front. Physiol, 2018)
590  g_fi_max = 3;
591  tau_r = 1 / 0.02;
592  tau_si = 1 / 0.0223;
593  tau_0 = 1 / 0.12;
594  tau_v_plus = 3.33;
595  tau_v1_minus = 1000;
596  tau_v2_minus = 19.6;
597  tau_w_plus = 667;
598  tau_w_minus = 11;
599  u_c = 0.13;
600  u_v = 0.055;
601  u_r = u_c;
602  u_fi = u_c;
603  u_csi = 0.85;
604  k1 = 10;
605  k2 = 0;
606  break;
607  case eCAF:
608  g_fi_max = 8;
609  tau_r = 70;
610  tau_si = 114;
611  tau_0 = 32.5; // 8.33
612  tau_v_plus = 5.75;
613  tau_v1_minus = 60;
614  tau_v2_minus = 82.5;
615  tau_w_plus = 300;
616  tau_w_minus = 400;
617  u_c = 0.16;
618  u_v = 0.04;
619  u_r = u_c;
620  u_fi = u_c;
621  u_csi = 0.85;
622  k1 = 10;
623  k2 = 0;
624  break;
625  }
626 
627  tau_d = C_m / g_fi_max;
628 
630 
631  // List gates and concentrations
632  m_gates.push_back(1);
633  m_gates.push_back(2);
634  m_nvar = 3;
635 
636  // Cherry-Fenton 2004 Model 3 has extra gating variable
637  if (isCF3)
638  {
639  m_gates.push_back(3);
640  m_nvar = 4;
641  }
642 
643  ASSERTL0(!isCF3, "Cherry-Fenton model 3 not implemented yet.");
644 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
std::vector< int > m_gates
Indices of cell model variables which are gates.
Definition: CellModel.h:141
size_t m_nvar
Number of variables in cell model (inc. transmembrane voltage)
Definition: CellModel.h:119
CellModel(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
Definition: CellModel.cpp:66
NekDouble tau_v1_minus
Definition: FentonKarma.h:87
NekDouble tau_w_plus
Definition: FentonKarma.h:99
NekDouble tau_y_plus
Definition: FentonKarma.h:93
enum Variants model_variant
Definition: FentonKarma.h:133
NekDouble tau_v2_minus
Definition: FentonKarma.h:88
NekDouble g_fi_max
Definition: FentonKarma.h:85
NekDouble tau_v_plus
Definition: FentonKarma.h:89
NekDouble tau_w_minus
Definition: FentonKarma.h:98
NekDouble tau_y_minus
Definition: FentonKarma.h:94

References ASSERTL0, C_m, eBR, eCAF, eCF1, eCF2a, eCF2b, eCF2c, eCF3a, eCF3b, eFC2002Set1a, eFC2002Set1b, eFC2002Set1c, eFC2002Set1d, eFC2002Set1e, eFC2002Set2, eFC2002Set4a, eFC2002Set4b, eFC2002Set4c, eFC2002Set4d, eFC2002Set5, eFC2002Set6, eFC2002Set7, eFC2002Set8, eFC2002Set9, eGP, eLawson, eMBR, eMLR1, g_fi_max, isCF3, k1, k2, Nektar::CellModel::m_gates, Nektar::CellModel::m_nvar, model_variant, tau_0, tau_d, tau_r, tau_si, tau_v1_minus, tau_v2_minus, tau_v_plus, tau_w_minus, tau_w_plus, tau_y_minus, tau_y_plus, u_c, u_csi, u_fi, u_r, u_v, V_0, and V_fi.

◆ ~FentonKarma()

Nektar::FentonKarma::~FentonKarma ( )
virtual

Destructor.

Definition at line 649 of file FentonKarma.cpp.

650 {
651 }

Member Function Documentation

◆ create()

static CellModelSharedPtr Nektar::FentonKarma::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const MultiRegions::ExpListSharedPtr pField 
)
inlinestatic

Creates an instance of this class.

Definition at line 46 of file FentonKarma.h.

49  {
50  return MemoryManager<FentonKarma>::AllocateSharedPtr(pSession, pField);
51  }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

◆ v_GenerateSummary()

void Nektar::FentonKarma::v_GenerateSummary ( SummaryList s)
overrideprotectedvirtual

Prints a summary of the model parameters.

Implements Nektar::CellModel.

Definition at line 732 of file FentonKarma.cpp.

733 {
734  SolverUtils::AddSummaryItem(s, "Cell model", "Fenton Karma");
735  SolverUtils::AddSummaryItem(s, "Cell model var.", lookupIds[model_variant]);
736 }
static std::string lookupIds[]
Definition: FentonKarma.h:135
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
Definition: Misc.cpp:49

References Nektar::SolverUtils::AddSummaryItem(), lookupIds, and model_variant.

◆ v_GetCellVarName()

std::string Nektar::FentonKarma::v_GetCellVarName ( size_t  idx)
overrideprotectedvirtual

Reimplemented from Nektar::CellModel.

Definition at line 749 of file FentonKarma.cpp.

750 {
751  switch (idx)
752  {
753  case 0:
754  return "u";
755  case 1:
756  return "v";
757  case 2:
758  return "w";
759  case 3:
760  return "y";
761  default:
762  return "unknown";
763  }
764 }

◆ v_SetInitialConditions()

void Nektar::FentonKarma::v_SetInitialConditions ( )
overrideprotectedvirtual

Implements Nektar::CellModel.

Definition at line 738 of file FentonKarma.cpp.

739 {
740  Vmath::Fill(m_nq, 0.0, m_cellSol[0], 1);
741  Vmath::Fill(m_nq, 1.0, m_cellSol[1], 1);
742  Vmath::Fill(m_nq, 1.0, m_cellSol[2], 1);
743  if (isCF3)
744  {
745  Vmath::Fill(m_nq, 0.1, m_cellSol[2], 1);
746  }
747 }
Array< OneD, Array< OneD, NekDouble > > m_cellSol
Cell model solution variables.
Definition: CellModel.h:126
size_t m_nq
Number of physical points.
Definition: CellModel.h:117
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:45

References Vmath::Fill(), isCF3, Nektar::CellModel::m_cellSol, and Nektar::CellModel::m_nq.

◆ v_Update()

void Nektar::FentonKarma::v_Update ( const Array< OneD, const Array< OneD, NekDouble >> &  inarray,
Array< OneD, Array< OneD, NekDouble >> &  outarray,
const NekDouble  time 
)
overrideprotectedvirtual

Computes the reaction terms $f(u,v)$ and $g(u,v)$.

Implements Nektar::CellModel.

Definition at line 653 of file FentonKarma.cpp.

656 {
657  boost::ignore_unused(time);
658  ASSERTL0(inarray.get() != outarray.get(),
659  "Must have different arrays for input and output.");
660 
661  // Variables
662  // 0 u membrane potential
663  // 1 v v gate
664  // 2 w w gate
665 
666  // Declare pointers
667  const NekDouble *u = &inarray[0][0];
668  const NekDouble *v = &inarray[1][0];
669  const NekDouble *w = &inarray[2][0];
670  const NekDouble *y = isCF3 ? &inarray[3][0] : 0;
671  NekDouble *u_new = &outarray[0][0];
672  NekDouble *v_new = &outarray[1][0];
673  NekDouble *w_new = &outarray[2][0];
674  // NekDouble *y_new = isCF3 ? &outarray[3][0] : 0;
675  NekDouble *v_tau = &m_gates_tau[0][0];
676  NekDouble *w_tau = &m_gates_tau[1][0];
677  // NekDouble *y_tau = isCF3 ? &m_gates_tau[2][0] : 0;
678 
679  // Temporary variables
680  NekDouble J_fi, J_so, J_si, h1, h2, h3, alpha, beta;
681 
682  double V;
683  // Compute rates for each point in domain
684  for (size_t i = 0; i < m_nq; ++i)
685  {
686  // *u is dimensional
687  // V is non-dimensional for what follows
688  V = (*u - V_0) / (V_fi - V_0);
689 
690  // Heavyside functions
691  h1 = (V < u_c) ? 0.0 : 1.0;
692  h2 = (V < u_v) ? 0.0 : 1.0;
693  h3 = (V < u_r) ? 0.0 : 1.0;
694 
695  // w-gate
696  alpha = (1 - h1) / tau_w_minus;
697  beta = h1 / tau_w_plus;
698  *w_tau = 1.0 / (alpha + beta);
699  *w_new = alpha * (*w_tau);
700 
701  // v-gate
702  alpha = (1 - h1) / (h2 * tau_v1_minus + (1 - h2) * tau_v2_minus);
703  beta = h1 / tau_v_plus;
704  *v_tau = 1.0 / (alpha + beta);
705  *v_new = alpha * (*v_tau);
706 
707  // y-gate
708  if (isCF3)
709  {
710  // TODO: implementation for y_tau and y_new
711  }
712 
713  // J_fi
714  J_fi = -(*v) * h1 * (1 - V) * (V - u_c) / tau_d;
715 
716  // J_so
717  // added extra (1-k2*v) term from Cherry&Fenton 2004
718  J_so = V * (1 - h3) * (1 - k2 * (*v)) / tau_0 +
719  (isCF3 ? h3 * V * (*y) / tau_r : h3 / tau_r);
720 
721  // J_si
722  J_si = -(*w) * (1 + tanh(k1 * (V - u_csi))) / (2.0 * tau_si);
723 
724  // u
725  *u_new = -J_fi - J_so - J_si;
726  *u_new *= C_m * (V_fi - V_0);
727 
728  ++u, ++v, ++w, ++u_new, ++v_new, ++w_new, ++v_tau, ++w_tau;
729  }
730 }
Array< OneD, Array< OneD, NekDouble > > m_gates_tau
Storage for gate tau values.
Definition: CellModel.h:143
@ beta
Gauss Radau pinned at x=-1,.
Definition: PointsType.h:61
double NekDouble

References ASSERTL0, Nektar::LibUtilities::beta, C_m, isCF3, k1, k2, Nektar::CellModel::m_gates_tau, Nektar::CellModel::m_nq, tau_0, tau_d, tau_r, tau_si, tau_v1_minus, tau_v2_minus, tau_v_plus, tau_w_minus, tau_w_plus, u_c, u_csi, u_r, u_v, V_0, and V_fi.

Member Data Documentation

◆ C_m

NekDouble Nektar::FentonKarma::C_m
private

Definition at line 78 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ className

std::string Nektar::FentonKarma::className
static
Initial value:
=
"FentonKarma", FentonKarma::create, "Phenomenological Model.")
static CellModelSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
Creates an instance of this class.
Definition: FentonKarma.h:46
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:198
CellModelFactory & GetCellModelFactory()
Definition: CellModel.cpp:46

Name of class.

Definition at line 54 of file FentonKarma.h.

◆ def

std::string Nektar::FentonKarma::def
staticprivate
Initial value:
=
"BR")
static std::string RegisterDefaultSolverInfo(const std::string &pName, const std::string &pValue)
Registers the default string value of a solver info property.

Definition at line 136 of file FentonKarma.h.

◆ g_fi_max

NekDouble Nektar::FentonKarma::g_fi_max
private

Definition at line 85 of file FentonKarma.h.

Referenced by FentonKarma().

◆ isCF3

bool Nektar::FentonKarma::isCF3
private

Definition at line 101 of file FentonKarma.h.

Referenced by FentonKarma(), v_SetInitialConditions(), and v_Update().

◆ k1

NekDouble Nektar::FentonKarma::k1
private

Definition at line 96 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ k2

NekDouble Nektar::FentonKarma::k2
private

Definition at line 97 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ lookupIds

std::string Nektar::FentonKarma::lookupIds
staticprivate

Definition at line 135 of file FentonKarma.h.

Referenced by v_GenerateSummary().

◆ model_variant

enum Variants Nektar::FentonKarma::model_variant
private

Definition at line 101 of file FentonKarma.h.

Referenced by FentonKarma(), and v_GenerateSummary().

◆ tau_0

NekDouble Nektar::FentonKarma::tau_0
private

Definition at line 90 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ tau_d

NekDouble Nektar::FentonKarma::tau_d
private

Definition at line 86 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ tau_r

NekDouble Nektar::FentonKarma::tau_r
private

Definition at line 91 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ tau_si

NekDouble Nektar::FentonKarma::tau_si
private

Definition at line 92 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ tau_v1_minus

NekDouble Nektar::FentonKarma::tau_v1_minus
private

Definition at line 87 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ tau_v2_minus

NekDouble Nektar::FentonKarma::tau_v2_minus
private

Definition at line 88 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ tau_v_plus

NekDouble Nektar::FentonKarma::tau_v_plus
private

Definition at line 89 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ tau_w_minus

NekDouble Nektar::FentonKarma::tau_w_minus
private

Definition at line 98 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ tau_w_plus

NekDouble Nektar::FentonKarma::tau_w_plus
private

Definition at line 99 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ tau_y_minus

NekDouble Nektar::FentonKarma::tau_y_minus
private

Definition at line 94 of file FentonKarma.h.

Referenced by FentonKarma().

◆ tau_y_plus

NekDouble Nektar::FentonKarma::tau_y_plus
private

Definition at line 93 of file FentonKarma.h.

Referenced by FentonKarma().

◆ u_c

NekDouble Nektar::FentonKarma::u_c
private

Definition at line 82 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ u_csi

NekDouble Nektar::FentonKarma::u_csi
private

Definition at line 95 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ u_fi

NekDouble Nektar::FentonKarma::u_fi
private

Definition at line 81 of file FentonKarma.h.

Referenced by FentonKarma().

◆ u_r

NekDouble Nektar::FentonKarma::u_r
private

Definition at line 84 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ u_v

NekDouble Nektar::FentonKarma::u_v
private

Definition at line 83 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ V_0

NekDouble Nektar::FentonKarma::V_0
private

Definition at line 79 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().

◆ V_fi

NekDouble Nektar::FentonKarma::V_fi
private

Definition at line 80 of file FentonKarma.h.

Referenced by FentonKarma(), and v_Update().