51 "Bidomain Roth model of cardiac electrophysiology.");
59 : UnsteadySystem(pSession)
69 UnsteadySystem::v_InitObject();
74 std::string vCellModel;
75 m_session->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
77 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
93 std::string varCoeffString[6] = {
"xx",
"xy",
"yy",
"xz",
"yz",
"zz"};
94 std::string aniso_var[3] = {
"fx",
"fy",
"fz"};
96 const int nq =
m_fields[0]->GetNpoints();
101 for (
int j = 0; j < i+1; ++j)
121 if (
m_session->DefinesFunction(
"ExtracellularAnisotropicConductivity"))
123 if (
m_session->DefinesCmdLineArgument(
"verbose"))
125 cout <<
"Loading Extracellular Anisotropic Fibre map." << endl;
155 "ExtracellularAnisotropicConductivity",
157 "Function 'AnisotropicConductivity' not correctly "
160 "ExtracellularAnisotropicConductivity");
163 for (
int i = 0; i < j + 1; ++i)
166 "ExtracellularAnisotropicConductivity",
168 "Function 'ExtracellularAnisotropicConductivity' not "
169 "correctly defined.");
172 "ExtracellularAnisotropicConductivity");
194 if (
m_session->DefinesFunction(
"IntracellularAnisotropicConductivity"))
196 if (
m_session->DefinesCmdLineArgument(
"verbose"))
198 cout <<
"Loading Anisotropic Fibre map." << endl;
228 "IntracellularAnisotropicConductivity",
230 "Function 'IntracellularAnisotropicConductivity' not "
231 "correctly defined.");
234 "IntracellularAnisotropicConductivity");
237 for (
int i = 0; i < j + 1; ++i)
240 "IntracellularAnisotropicConductivity",
242 "Function 'IntracellularAnisotropicConductivity' not "
243 "correctly defined.");
245 "IntracellularAnisotropicConductivity");
275 for (
int i = 0; i < j + 1; ++i)
280 std::stringstream filenamei;
281 filenamei <<
"IConductivity_" << varCoeffString[k] <<
".fld";
287 std::stringstream filenamee;
288 filenamee <<
"EConductivity_" << varCoeffString[k] <<
".fld";
299 LibUtilities::FilterMap::const_iterator x;
300 for (x = f.begin(); x != f.end(); ++x, ++k)
302 if (x->first ==
"CheckpointCellModel")
304 boost::shared_ptr<FilterCheckpointCellModel> c
369 outarray[0] =
m_fields[0]->GetPhys();
384 m_cell->TimeIntegrate(inarray, outarray, time);
387 for (
unsigned int i = 0; i <
m_stimulus.size(); ++i)
399 m_fields[0]->PhysDeriv(inarray[0], ggrad0, ggrad1, ggrad2);
400 m_fields[0]->PhysDeriv(0, ggrad0, ggrad0);
401 m_fields[0]->PhysDeriv(1, ggrad1, ggrad1);
402 m_fields[0]->PhysDeriv(2, ggrad2, ggrad2);
403 if (
m_session->DefinesFunction(
"IntracellularAnisotropicConductivity") &&
404 m_session->DefinesFunction(
"ExtracellularAnisotropicConductivity"))
433 m_fields[1]->PhysDeriv(0, ggrad0, ggrad0);
434 m_fields[1]->PhysDeriv(1, ggrad1, ggrad1);
435 m_fields[1]->PhysDeriv(2, ggrad2, ggrad2);
436 if (
m_session->DefinesFunction(
"IntracellularAnisotropicConductivity") &&
437 m_session->DefinesFunction(
"ExtracellularAnisotropicConductivity"))
450 Vmath::Vadd(nq, ggrad, 1, outarray[0], 1, outarray[0], 1);
458 bool dumpInitialConditions,
461 EquationSystem::v_SetInitialConditions(initialtime,
462 dumpInitialConditions,
473 UnsteadySystem::v_GenerateSummary(s);
474 m_cell->GenerateSummary(s);
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
#define ASSERTL0(condition, msg)
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Computes the reaction terms and .
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)
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
virtual void v_InitObject()
Init object for UnsteadySystem class.
virtual void v_GenerateSummary(SummaryList &s)
Prints a summary of the model parameters.
void SetCellModel(CellModelSharedPtr &pCellModel)
std::map< ConstFactorType, NekDouble > ConstFactorMap
std::vector< std::pair< std::string, std::string > > SummaryList
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
StdRegions::VarCoeffMap m_vardiffe
static std::vector< StimulusSharedPtr > LoadStimuli(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
std::vector< StimulusSharedPtr > m_stimulus
BidomainRoth(const LibUtilities::SessionReaderSharedPtr &pSession)
Constructor.
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.
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)
static std::string className
Name of class.
std::vector< std::pair< std::string, FilterParams > > FilterMap
int m_spacedim
Spatial dimension (>= expansion dim).
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.
StdRegions::VarCoeffMap m_vardiffie
EquationSystemFactory & GetEquationSystemFactory()
CellModelFactory & GetCellModelFactory()
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
CellModelSharedPtr m_cell
Cell model.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
StdRegions::VarCoeffMap m_vardiffi
std::vector< FilterSharedPtr > m_filters
virtual void v_SetInitialConditions(NekDouble initialtime, bool dumpInitialConditions, const int domain)
Sets a custom initial condition.
virtual ~BidomainRoth()
Desctructor.
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
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.