Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
LuoRudySpiralWaveCellFactory.hpp
1/*
2
3Copyright (c) 2005-2024, University of Oxford.
4All rights reserved.
5
6University of Oxford means the Chancellor, Masters and Scholars of the
7University of Oxford, having an administrative office at Wellington
8Square, Oxford OX1 2JD, UK.
9
10This file is part of Chaste.
11
12Redistribution and use in source and binary forms, with or without
13modification, are permitted provided that the following conditions are met:
14 * Redistributions of source code must retain the above copyright notice,
15 this list of conditions and the following disclaimer.
16 * Redistributions in binary form must reproduce the above copyright notice,
17 this list of conditions and the following disclaimer in the documentation
18 and/or other materials provided with the distribution.
19 * Neither the name of the University of Oxford nor the names of its
20 contributors may be used to endorse or promote products derived from this
21 software without specific prior written permission.
22
23THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34*/
35
36#ifndef LUORUDYSPIRALWAVECELLFACTORY_HPP_
37#define LUORUDYSPIRALWAVECELLFACTORY_HPP_
38
39#include "LuoRudy1991BackwardEuler.hpp"
40#include "AbstractCardiacCellFactory.hpp"
41#include "MultiStimulus.hpp"
42#include "SimpleStimulus.hpp"
43
50{
51private:
53 boost::shared_ptr<SimpleStimulus> mpS1Stimulus;
55 boost::shared_ptr<SimpleStimulus> mpS2Stimulus;
57 boost::shared_ptr<MultiStimulus> mpBothStimulus;
59 double mXExtent;
61 double mYExtent;
62public:
69 LuoRudySpiralWaveCellFactory(double xExtent, double yExtent)
71 mpS1Stimulus(new SimpleStimulus(-50000.0, 2, 0)),
72 mpS2Stimulus(new SimpleStimulus(-70000.0, 2, 45)),
74 mXExtent(xExtent),
75 mYExtent(yExtent)
76 {
77 mpBothStimulus->AddStimulus(mpS1Stimulus);
78 mpBothStimulus->AddStimulus(mpS2Stimulus);
79 }
80
91 {
92 double x = pNode->rGetLocation()[0];
93 double y = pNode->rGetLocation()[1];
94
95 double x_threshold_for_S1 = 0.1 + 1e-6;
96 double x_threshold_for_S2 = mXExtent*0.6;
97 double y_threshold_for_S2 = mYExtent*0.5;
98
99 AbstractCardiacCell* p_cell;
100 if (x < x_threshold_for_S1)
101 {
102 if (y < y_threshold_for_S2)
103 {
104 p_cell = new CellLuoRudy1991FromCellMLBackwardEuler(mpSolver, mpBothStimulus);
105 }
106 else
107 {
108 p_cell = new CellLuoRudy1991FromCellMLBackwardEuler(mpSolver, mpS1Stimulus);
109 }
110 }
111 else if ((x < x_threshold_for_S2) && (y < y_threshold_for_S2))
112 {
113 p_cell = new CellLuoRudy1991FromCellMLBackwardEuler(mpSolver, mpS2Stimulus);
114 }
115 else
116 {
117 p_cell = new CellLuoRudy1991FromCellMLBackwardEuler(mpSolver, this->mpZeroStimulus);
118 }
119
120 // Alter parameters to match those used in
121 // Qu et al. Origins of Spiral Wave Meander and Breakup... Annals of Biomedical Eng. 28:755-771 (2000).
122 p_cell->SetParameter("membrane_L_type_calcium_current_conductance",0); // slow inward current in original model.
123
124 unsigned node_index = pNode->GetIndex();
125 if (node_index==0)
126 {
127// std::cout << "[K_o] = " << p_cell->GetAnyVariable("extracellular_potassium_concentration") << "mM \n";
128// std::cout << "[K_i] = " << p_cell->GetAnyVariable("cytosolic_potassium_concentration") << "mM \n";
129// std::cout << "[Na_o] = " << p_cell->GetAnyVariable("extracellular_sodium_concentration") << "mM \n";
130// std::cout << "[Na_i] = " << p_cell->GetAnyVariable("cytosolic_sodium_concentration") << "mM \n";
131 std::cout << "G_si = " << p_cell->GetAnyVariable("membrane_L_type_calcium_current_conductance") << "\n";
132// std::cout << "G_Na = " << p_cell->GetAnyVariable("membrane_fast_sodium_current_conductance") << "mM \n";
133// std::cout << "G_K = " << p_cell->GetAnyVariable("membrane_rapid_delayed_rectifier_potassium_current_conductance") << "mM \n";
134// std::cout << "G_K1 = " << p_cell->GetAnyVariable("membrane_inward_rectifier_potassium_current_conductance") << "mM \n";
135 }
136 return p_cell;
137 }
138};
139
140#endif // LUORUDYSPIRALWAVECELLFACTORY_HPP_
boost::shared_ptr< AbstractIvpOdeSolver > mpSolver
boost::shared_ptr< ZeroStimulus > mpZeroStimulus
void SetParameter(const std::string &rParameterName, double value)
double GetAnyVariable(const std::string &rName, double time=0.0)
LuoRudySpiralWaveCellFactory(double xExtent, double yExtent)
boost::shared_ptr< SimpleStimulus > mpS1Stimulus
boost::shared_ptr< SimpleStimulus > mpS2Stimulus
boost::shared_ptr< MultiStimulus > mpBothStimulus
AbstractCardiacCell * CreateCardiacCellForTissueNode(Node< 2 > *pNode)
Definition Node.hpp:59
const c_vector< double, SPACE_DIM > & rGetLocation() const
Definition Node.cpp:139
unsigned GetIndex() const
Definition Node.cpp:158