49 string BidomainRoth::className
53 "Bidomain Roth model of cardiac electrophysiology.");
59 BidomainRoth::BidomainRoth(
76 std::string vCellModel;
77 m_session->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
79 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
95 std::string varCoeffString[6] = {
"xx",
"xy",
"yy",
"xz",
"yz",
"zz"};
96 std::string aniso_var[3] = {
"fx",
"fy",
"fz"};
98 const int nq =
m_fields[0]->GetNpoints();
103 for (
int j = 0; j < i+1; ++j)
123 if (
m_session->DefinesFunction(
"ExtracellularAnisotropicConductivity"))
125 if (
m_session->DefinesCmdLineArgument(
"verbose"))
127 cout <<
"Loading Extracellular Anisotropic Fibre map." << endl;
157 "ExtracellularAnisotropicConductivity",
159 "Function 'AnisotropicConductivity' not correctly "
162 "ExtracellularAnisotropicConductivity");
165 for (
int i = 0; i < j + 1; ++i)
168 "ExtracellularAnisotropicConductivity",
170 "Function 'ExtracellularAnisotropicConductivity' not "
171 "correctly defined.");
174 "ExtracellularAnisotropicConductivity");
196 if (
m_session->DefinesFunction(
"IntracellularAnisotropicConductivity"))
198 if (
m_session->DefinesCmdLineArgument(
"verbose"))
200 cout <<
"Loading Anisotropic Fibre map." << endl;
230 "IntracellularAnisotropicConductivity",
232 "Function 'IntracellularAnisotropicConductivity' not "
233 "correctly defined.");
236 "IntracellularAnisotropicConductivity");
239 for (
int i = 0; i < j + 1; ++i)
242 "IntracellularAnisotropicConductivity",
244 "Function 'IntracellularAnisotropicConductivity' not "
245 "correctly defined.");
247 "IntracellularAnisotropicConductivity");
277 for (
int i = 0; i < j + 1; ++i)
282 std::stringstream filenamei;
283 filenamei <<
"IConductivity_" << varCoeffString[k] <<
".fld";
289 std::stringstream filenamee;
290 filenamee <<
"EConductivity_" << varCoeffString[k] <<
".fld";
301 LibUtilities::FilterMap::const_iterator x;
302 for (x = f.begin(); x != f.end(); ++x, ++k)
304 if (x->first ==
"CheckpointCellModel")
306 boost::shared_ptr<FilterCheckpointCellModel> c
371 outarray[0] =
m_fields[0]->GetPhys();
386 m_cell->TimeIntegrate(inarray, outarray, time);
389 for (
unsigned int i = 0; i <
m_stimulus.size(); ++i)
401 m_fields[0]->PhysDeriv(inarray[0], ggrad0, ggrad1, ggrad2);
402 m_fields[0]->PhysDeriv(0, ggrad0, ggrad0);
403 m_fields[0]->PhysDeriv(1, ggrad1, ggrad1);
404 m_fields[0]->PhysDeriv(2, ggrad2, ggrad2);
405 if (
m_session->DefinesFunction(
"IntracellularAnisotropicConductivity") &&
406 m_session->DefinesFunction(
"ExtracellularAnisotropicConductivity"))
435 m_fields[1]->PhysDeriv(0, ggrad0, ggrad0);
436 m_fields[1]->PhysDeriv(1, ggrad1, ggrad1);
437 m_fields[1]->PhysDeriv(2, ggrad2, ggrad2);
438 if (
m_session->DefinesFunction(
"IntracellularAnisotropicConductivity") &&
439 m_session->DefinesFunction(
"ExtracellularAnisotropicConductivity"))
452 Vmath::Vadd(nq, ggrad, 1, outarray[0], 1, outarray[0], 1);
460 bool dumpInitialConditions,
464 dumpInitialConditions,
476 m_cell->GenerateSummary(s);
#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.
std::vector< std::pair< std::string, std::string > > SummaryList
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
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
StdRegions::VarCoeffMap m_vardiffe
static std::vector< StimulusSharedPtr > LoadStimuli(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s)
Print a summary of time stepping parameters.
std::vector< StimulusSharedPtr > m_stimulus
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)
Base class for unsteady solvers.
std::vector< std::pair< std::string, FilterParams > > FilterMap
int m_spacedim
Spatial dimension (>= expansion dim).
virtual SOLVER_UTILS_EXPORT void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
virtual SOLVER_UTILS_EXPORT void v_InitObject()
Init object for UnsteadySystem class.
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.