643 ASSERTL0(!
isCF3,
"Cherry-Fenton model 3 not implemented yet.");
658 ASSERTL0(inarray.get() != outarray.get(),
659 "Must have different arrays for input and output.");
684 for (
size_t i = 0; i <
m_nq; ++i)
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;
698 *w_tau = 1.0 / (alpha +
beta);
699 *w_new = alpha * (*w_tau);
704 *v_tau = 1.0 / (alpha +
beta);
705 *v_new = alpha * (*v_tau);
714 J_fi = -(*v) * h1 * (1 - V) * (V -
u_c) /
tau_d;
718 J_so = V * (1 - h3) * (1 -
k2 * (*v)) /
tau_0 +
722 J_si = -(*w) * (1 + tanh(
k1 * (V -
u_csi))) / (2.0 *
tau_si);
725 *u_new = -J_fi - J_so - J_si;
728 ++u, ++v, ++
w, ++u_new, ++v_new, ++w_new, ++v_tau, ++w_tau;
#define ASSERTL0(condition, msg)
Array< OneD, Array< OneD, NekDouble > > m_cellSol
Cell model solution variables.
std::vector< int > m_gates
Indices of cell model variables which are gates.
size_t m_nq
Number of physical points.
size_t m_nvar
Number of variables in cell model (inc. transmembrane voltage)
Array< OneD, Array< OneD, NekDouble > > m_gates_tau
Storage for gate tau values.
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)$.
enum Variants model_variant
FentonKarma(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
Constructor.
~FentonKarma() override
Destructor.
std::string v_GetCellVarName(size_t idx) override
static CellModelSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
Creates an instance of this class.
static std::string lookupIds[]
void v_GenerateSummary(SummaryList &s) override
Prints a summary of the model parameters.
void v_SetInitialConditions() override
static std::string className
Name of class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
static std::string RegisterDefaultSolverInfo(const std::string &pName, const std::string &pValue)
Registers the default string value of a solver info property.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ beta
Gauss Radau pinned at x=-1,.
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::vector< std::pair< std::string, std::string > > SummaryList
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
std::vector< double > w(NPUPPER)
CellModelFactory & GetCellModelFactory()
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.