65 "Monodomain model of cardiac electrophysiology.");
83 UnsteadySystem::v_InitObject();
88 std::string vCellModel;
89 m_session->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
91 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
107 std::string varCoeffString[6] = {
"xx",
"xy",
"yy",
"xz",
"yz",
"zz"};
108 std::string aniso_var[3] = {
"fx",
"fy",
"fz"};
110 const int nq =
m_fields[0]->GetNpoints();
116 for (
int j = 0; j < i+1; ++j)
132 if (
m_session->DefinesFunction(
"AnisotropicConductivity"))
134 if (
m_session->DefinesCmdLineArgument(
"verbose"))
136 cout <<
"Loading Anisotropic Fibre map." << endl;
167 "Function 'AnisotropicConductivity' not correctly "
170 "AnisotropicConductivity");
173 for (
int i = 0; i < j + 1; ++i)
176 "AnisotropicConductivity",aniso_var[i]),
177 "Function 'AnisotropicConductivity' not correctly "
180 "AnisotropicConductivity");
205 for (
int i = 0; i < nVarDiffCmpts; ++i)
215 if (
m_session->DefinesFunction(
"IsotropicConductivity"))
217 if (
m_session->DefinesCmdLineArgument(
"verbose"))
219 cout <<
"Loading Isotropic Conductivity map." << endl;
222 const std::string varName =
"intensity";
229 if (
m_session->DefinesParameter(
"d_min") ||
237 for (
int j = 0; j < nq; ++j)
239 vTemp[j] = (vTemp[j] < f_min ? f_min : vTemp[j]);
240 vTemp[j] = (vTemp[j] > f_max ? f_max : vTemp[j]);
245 Vmath::Smul(nq, -1.0/(f_max-f_min), vTemp, 1, vTemp, 1);
247 Vmath::Smul(nq, scar_max - scar_min, vTemp, 1, vTemp, 1);
252 for (
int i = 0; i < nVarDiffCmpts; ++i)
265 for (
int i = 0; i < j + 1; ++i)
270 std::stringstream filename;
271 filename <<
"Conductivity_" << varCoeffString[k] <<
".fld";
282 LibUtilities::FilterMap::const_iterator x;
283 for (x = f.begin(); x != f.end(); ++x, ++k)
285 if (x->first ==
"CheckpointCellModel")
287 boost::shared_ptr<FilterCheckpointCellModel> c
292 if (x->first ==
"CellHistoryPoints")
294 boost::shared_ptr<FilterCellHistoryPoints> c
333 int nvariables = inarray.num_elements();
343 for (
int i = 0; i < nvariables; ++i)
360 outarray[i] =
m_fields[i]->GetPhys();
374 m_cell->TimeIntegrate(inarray, outarray, time);
377 for (
unsigned int i = 0; i <
m_stimulus.size(); ++i)
388 bool dumpInitialConditions,
391 EquationSystem::v_SetInitialConditions(initialtime,
392 dumpInitialConditions,
403 UnsteadySystem::v_GenerateSummary(s);
405 m_session->GetFunctionType(
"d00",
"intensity")
409 m_session->GetFunction(
"d00",
"intensity")->GetExpression());
412 m_session->GetFunctionType(
"d11",
"intensity")
416 m_session->GetFunction(
"d11",
"intensity")->GetExpression());
419 m_session->GetFunctionType(
"d22",
"intensity")
423 m_session->GetFunction(
"d22",
"intensity")->GetExpression());
425 m_cell->GenerateSummary(s);
void DoImplicitSolve(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, NekDouble time, NekDouble lambda)
Solve for the diffusion term.
#define ASSERTL0(condition, msg)
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
bool m_explicitDiffusion
Indicates if explicit or implicit treatment of diffusion is used.
void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj)
virtual void v_InitObject()
Init object for UnsteadySystem class.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
Monodomain(const LibUtilities::SessionReaderSharedPtr &pSession)
Constructor.
StdRegions::VarCoeffMap m_vardiff
Variable diffusivity.
void SetCellModel(CellModelSharedPtr &pCellModel)
std::map< ConstFactorType, NekDouble > ConstFactorMap
std::vector< std::pair< std::string, std::string > > SummaryList
void SetCellModel(CellModelSharedPtr &pCellModel)
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
static std::vector< StimulusSharedPtr > LoadStimuli(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
CellModelSharedPtr m_cell
Cell model.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
Base class for unsteady solvers.
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
virtual void v_GenerateSummary(SummaryList &s)
Prints a summary of the model parameters.
std::vector< std::pair< std::string, FilterParams > > FilterMap
int m_spacedim
Spatial dimension (>= expansion dim).
virtual ~Monodomain()
Desctructor.
SOLVER_UTILS_EXPORT void EvaluateFunction(Array< OneD, Array< OneD, NekDouble > > &pArray, std::string pFunctionName, const NekDouble pTime=0.0, const int domain=0)
Evaluates a function as specified in the session file.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
EquationSystemFactory & GetEquationSystemFactory()
CellModelFactory & GetCellModelFactory()
std::vector< StimulusSharedPtr > m_stimulus
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
static std::string className
Name of class.
virtual void v_SetInitialConditions(NekDouble initialtime, bool dumpInitialConditions, const int domain)
Sets a custom initial condition.
std::vector< FilterSharedPtr > m_filters
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Computes the reaction terms and .
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
static FlagList NullFlagList
An empty flag list.
std::vector< int > m_intVariables
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.