45 std::stringstream ss(ionOpts);
48 CepsString(
" Each ionic model input must have the following structure:\n") +
49 " - an integer for the unknown concerned by the model\n" +
50 " - a model name,\n" +
51 " - optionally, one or several integers for the attribute(s) of the region(s)\n" +
52 " in which to use this model,\n" +
53 " Given ionic model is: " + ionOpts;
69 "Cannot assign ionic model " << type <<
" to region with attribute " << attr <<
70 " for unknown " << uId <<
" as another ionic model was assigned there"
72 prevAttrs[uId].insert(attr);
79 if (type ==
"TENTUSSCHER2006_ENDO" or type ==
"TTP06_ENDO")
82 else if (type ==
"TENTUSSCHER2006_MIDMYO" or type ==
"TTP06_MIDMYO")
85 else if (type ==
"TENTUSSCHER2006_EPI" or type ==
"TTP06_EPI")
88 else if (type ==
"MS" or type ==
"MS03")
89 res = ceps::getNew<MS03>(u,attrs,params);
91 else if (type ==
"MS_MODIFIED" or type ==
"MS03_MODIFIED")
92 res = ceps::getNew<MS03Modified>(u,attrs,params);
94 else if (type ==
"AP" or type ==
"AP95")
95 res = ceps::getNew<AP95>(u,attrs,params);
97 else if (type ==
"CRN" or type ==
"CRN98")
98 res = ceps::getNew<CRN98>(u,attrs,params);
100 else if (type ==
"BEELERREUTER" or type ==
"BR77")
101 res = ceps::getNew<BR77>(u,pb,attrs,params);
103 else if (type ==
"BR_MODIFIED" or type ==
"BR77_MODIFIED")
104 res = ceps::getNew<BR77Modified>(u,pb,attrs,params);
106 else if (type ==
"ORDMD16_ENDO")
109 else if (type ==
"ORDMD16_EPI")
112 else if (type ==
"ORDMD16_MIDMYO")
116 CEPS_ABORT (
"Unknown ionic model type \"" << type <<
"\"\n" <<
117 " Valid types are\n" <<
118 " - TenTusscher2006_Endo (or TTP06_Endo)\n" <<
119 " - TenTusscher2006_MidMyo (or TTP06_MidMyo)\n" <<
120 " - TenTusscher2006_Epi (or TTP06_Epi)\n" <<
121 " - ORdmD16_Endo\n" <<
122 " - ORdmD16_MidMyo\n" <<
123 " - ORdmD16_Epi\n" <<
124 " - MS (or MS03)\n" <<
125 " - MS_Modified (or MS03_Modified)\n" <<
126 " - AP (or AP95)\n" <<
127 " - CRN (or CRN98)\n" <<
128 " - BeelerReuter (or BR77)\n" <<
129 " - BR_Modified (or BR77_Modified)"
132 if (not tissueAttrs.empty())
133 CEPS_SAYS(
"Added ionic model " << type <<
" to region with attributes " << attrs);
AbstractIonicModel * getIonicModelFromString(CepsString ionOpts, InputParameters *params, AbstractPdeProblem *pb, CepsMap< CepsUnknownIndex, CepsSet< CepsAttribute >> &prevAttrs, const CepsSet< CepsAttribute > &tissueAttrs)
Obtain a new instance of ionic model from input string.
#define CEPS_ABORT(message)
Stops the execution with a message. If testing is enabled, only throws a runtime_error.
#define CEPS_SAYS(message)
Writes a message in the debug log and in the terminal (stdio).
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
std::basic_string< CepsChar > CepsString
C++ format string.
CepsIndex CepsUnknownIndex
For unknowns.
std::map< _Key, _Tp, _Compare, _Alloc > CepsMap
C++ map.
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
CepsInt CepsAttribute
Used to define regions.
Represents a ionic model for a group of cells, i.e. multiple systems of ODEs.
Base class for creating PDEs to solve.
Unknown * getUnknown(const CepsString &label) const
Get an unknown by its name.
@ Epi
Model variant selector.
@ MidMyo
Model variant selector.
@ Endo
Model variant selector.
@ Epi
Model variant selector.
@ MidMyo
Model variant selector.
@ Endo
Model variant selector.
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
CepsBool contains(const CepsVector< _Type, _Alloc > &vec, const _Type &item)
Tells if vectors contains a given item.
CepsInt readInt(std::istream &file, const CepsString &errorMessage="")
Reads an integral number from an istream, aborts if conversion fails advances the stream by 1 word.
CepsString toUpper(const CepsString &s)
Switches all characters to upper case.