51 "Bidomain Roth model of cardiac electrophysiology.");
72 std::string vCellModel;
73 m_session->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
75 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
87 std::string varCoeffString[6] = {
"xx",
"xy",
"yy",
"xz",
"yz",
"zz"};
88 std::string aniso_var[3] = {
"fx",
"fy",
"fz"};
90 const int nq =
m_fields[0]->GetNpoints();
95 for (
int j = 0; j < i + 1; ++j)
115 if (
m_session->DefinesFunction(
"ExtracellularAnisotropicConductivity"))
117 if (
m_session->DefinesCmdLineArgument(
"verbose"))
119 cout <<
"Loading Extracellular Anisotropic Fibre map." << endl;
149 "ExtracellularAnisotropicConductivity", aniso_var[j]),
150 "Function 'AnisotropicConductivity' not correctly "
153 GetFunction(
"ExtracellularAnisotropicConductivity")
154 ->Evaluate(aniso_var[j], vTemp_j);
157 for (
int i = 0; i < j + 1; ++i)
161 "ExtracellularAnisotropicConductivity", aniso_var[i]),
162 "Function 'ExtracellularAnisotropicConductivity' not "
163 "correctly defined.");
165 GetFunction(
"ExtracellularAnisotropicConductivity")
166 ->Evaluate(aniso_var[i], vTemp_i);
186 if (
m_session->DefinesFunction(
"IntracellularAnisotropicConductivity"))
188 if (
m_session->DefinesCmdLineArgument(
"verbose"))
190 cout <<
"Loading Anisotropic Fibre map." << endl;
220 "IntracellularAnisotropicConductivity", aniso_var[j]),
221 "Function 'IntracellularAnisotropicConductivity' not "
222 "correctly defined.");
224 GetFunction(
"IntracellularAnisotropicConductivity")
225 ->Evaluate(aniso_var[j], vTemp_j);
228 for (
int i = 0; i < j + 1; ++i)
232 "IntracellularAnisotropicConductivity", aniso_var[i]),
233 "Function 'IntracellularAnisotropicConductivity' not "
234 "correctly defined.");
235 GetFunction(
"IntracellularAnisotropicConductivity")
236 ->Evaluate(aniso_var[i], vTemp_i);
265 for (
int i = 0; i < j + 1; ++i)
271 std::stringstream filenamei;
272 filenamei <<
"IConductivity_" << varCoeffString[k] <<
".fld";
279 std::stringstream filenamee;
280 filenamee <<
"EConductivity_" << varCoeffString[k] <<
".fld";
291 if (x.first ==
"CheckpointCellModel")
293 std::shared_ptr<FilterCheckpointCellModel> c =
294 std::dynamic_pointer_cast<FilterCheckpointCellModel>(x.second);
351 outarray[0] =
m_fields[0]->GetPhys();
364 m_cell->TimeIntegrate(inarray, outarray, time);
367 for (
unsigned int i = 0; i <
m_stimulus.size(); ++i)
379 m_fields[0]->PhysDeriv(inarray[0], ggrad0, ggrad1, ggrad2);
380 m_fields[0]->PhysDeriv(0, ggrad0, ggrad0);
381 m_fields[0]->PhysDeriv(1, ggrad1, ggrad1);
382 m_fields[0]->PhysDeriv(2, ggrad2, ggrad2);
383 if (
m_session->DefinesFunction(
"IntracellularAnisotropicConductivity") &&
384 m_session->DefinesFunction(
"ExtracellularAnisotropicConductivity"))
411 m_fields[1]->PhysDeriv(0, ggrad0, ggrad0);
412 m_fields[1]->PhysDeriv(1, ggrad1, ggrad1);
413 m_fields[1]->PhysDeriv(2, ggrad2, ggrad2);
414 if (
m_session->DefinesFunction(
"IntracellularAnisotropicConductivity") &&
415 m_session->DefinesFunction(
"ExtracellularAnisotropicConductivity"))
428 Vmath::Vadd(nq, ggrad, 1, outarray[0], 1, outarray[0], 1);
435 bool dumpInitialConditions,
449 m_cell->GenerateSummary(s);
#define ASSERTL0(condition, msg)
void v_GenerateSummary(SummaryList &s) override
Prints a summary of the model parameters.
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Computes the reaction terms and .
StdRegions::VarCoeffMap m_vardiffi
std::vector< StimulusSharedPtr > m_stimulus
void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
static std::string className
Name of class.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
BidomainRoth(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
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.
CellModelSharedPtr m_cell
Cell model.
void v_SetInitialConditions(NekDouble initialtime, bool dumpInitialConditions, const int domain) override
Sets a custom initial condition.
StdRegions::VarCoeffMap m_vardiffie
~BidomainRoth() override
Desctructor.
StdRegions::VarCoeffMap m_vardiffe
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj)
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)
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
Get a SessionFunction by name.
Base class for unsteady solvers.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
std::vector< std::pair< std::string, FilterSharedPtr > > m_filters
SOLVER_UTILS_EXPORT void DoDummyProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Perform dummy projection.
bool m_explicitDiffusion
Indicates if explicit or implicit treatment of diffusion is used.
SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s) override
Print a summary of time stepping parameters.
std::vector< int > m_intVariables
SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
static std::vector< StimulusSharedPtr > LoadStimuli(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::vector< std::pair< std::string, std::string > > SummaryList
EquationSystemFactory & GetEquationSystemFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
CellModelFactory & GetCellModelFactory()
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.
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 Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.