65 "Monodomain model of cardiac electrophysiology.");
86 std::string vCellModel;
87 m_session->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
89 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
101 std::string varCoeffString[6] = {
"xx",
"xy",
"yy",
"xz",
"yz",
"zz"};
102 std::string aniso_var[3] = {
"fx",
"fy",
"fz"};
104 const int nq =
m_fields[0]->GetNpoints();
110 for (
int j = 0; j < i + 1; ++j)
126 if (
m_session->DefinesFunction(
"AnisotropicConductivity"))
128 if (
m_session->DefinesCmdLineArgument(
"verbose"))
130 cout <<
"Loading Anisotropic Fibre map." << endl;
161 "Function 'AnisotropicConductivity' not correctly "
164 ->Evaluate(aniso_var[j], vTemp_j);
167 for (
int i = 0; i < j + 1; ++i)
171 "Function 'AnisotropicConductivity' not correctly "
174 ->Evaluate(aniso_var[i], vTemp_i);
196 for (
int i = 0; i < nVarDiffCmpts; ++i)
206 if (
m_session->DefinesFunction(
"IsotropicConductivity"))
208 if (
m_session->DefinesCmdLineArgument(
"verbose"))
210 cout <<
"Loading Isotropic Conductivity map." << endl;
213 const std::string varName =
"intensity";
215 GetFunction(
"IsotropicConductivity")->Evaluate(varName, vTemp);
220 if (
m_session->DefinesParameter(
"d_min") ||
229 for (
int j = 0; j < nq; ++j)
231 vTemp[j] = (vTemp[j] < f_min ? f_min : vTemp[j]);
232 vTemp[j] = (vTemp[j] > f_max ? f_max : vTemp[j]);
237 Vmath::Smul(nq, -1.0 / (f_max - f_min), vTemp, 1, vTemp, 1);
239 Vmath::Smul(nq, scar_max - scar_min, vTemp, 1, vTemp, 1);
244 for (
int i = 0; i < nVarDiffCmpts; ++i)
256 for (
int i = 0; i < j + 1; ++i)
262 std::stringstream filename;
263 filename <<
"Conductivity_" << varCoeffString[k] <<
".fld";
274 if (x.first ==
"CheckpointCellModel")
276 std::shared_ptr<FilterCheckpointCellModel> c =
277 std::dynamic_pointer_cast<FilterCheckpointCellModel>(x.second);
280 if (x.first ==
"CellHistoryPoints")
282 std::shared_ptr<FilterCellHistoryPoints> c =
283 std::dynamic_pointer_cast<FilterCellHistoryPoints>(x.second);
317 int nvariables = inarray.size();
327 for (
int i = 0; i < nvariables; ++i)
343 outarray[i] =
m_fields[i]->GetPhys();
355 m_cell->TimeIntegrate(inarray, outarray, time);
358 for (
unsigned int i = 0; i <
m_stimulus.size(); ++i)
368 bool dumpInitialConditions,
383 m_session->GetFunctionType(
"d00",
"intensity") ==
388 m_session->GetFunction(
"d00",
"intensity")->GetExpression());
391 m_session->GetFunctionType(
"d11",
"intensity") ==
396 m_session->GetFunction(
"d11",
"intensity")->GetExpression());
399 m_session->GetFunctionType(
"d22",
"intensity") ==
404 m_session->GetFunction(
"d22",
"intensity")->GetExpression());
406 m_cell->GenerateSummary(s);
#define ASSERTL0(condition, msg)
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)
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 v_SetInitialConditions(NekDouble initialtime, bool dumpInitialConditions, const int domain) override
Sets a custom initial condition.
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Computes the reaction terms and .
Monodomain(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
~Monodomain() override
Desctructor.
CellModelSharedPtr m_cell
Cell model.
StdRegions::VarCoeffMap m_vardiff
Variable diffusivity.
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
std::vector< StimulusSharedPtr > m_stimulus
static std::string className
Name of class.
void v_GenerateSummary(SummaryList &s) override
Prints a summary of the model parameters.
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
@ eFunctionTypeExpression
std::vector< std::pair< std::string, std::string > > SummaryList
EquationSystemFactory & GetEquationSystemFactory()
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
StdRegions::ConstFactorMap factors
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 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.