63 string Monodomain::className
67 "Monodomain model of cardiac electrophysiology.");
73 Monodomain::Monodomain(
90 std::string vCellModel;
91 m_session->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
93 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
109 std::string varCoeffString[6] = {
"xx",
"xy",
"yy",
"xz",
"yz",
"zz"};
110 std::string aniso_var[3] = {
"fx",
"fy",
"fz"};
112 const int nq =
m_fields[0]->GetNpoints();
118 for (
int j = 0; j < i+1; ++j)
134 if (
m_session->DefinesFunction(
"AnisotropicConductivity"))
136 if (
m_session->DefinesCmdLineArgument(
"verbose"))
138 cout <<
"Loading Anisotropic Fibre map." << endl;
169 "Function 'AnisotropicConductivity' not correctly "
172 "AnisotropicConductivity");
175 for (
int i = 0; i < j + 1; ++i)
178 "AnisotropicConductivity",aniso_var[i]),
179 "Function 'AnisotropicConductivity' not correctly "
182 "AnisotropicConductivity");
207 for (
int i = 0; i < nVarDiffCmpts; ++i)
217 if (
m_session->DefinesFunction(
"IsotropicConductivity"))
219 if (
m_session->DefinesCmdLineArgument(
"verbose"))
221 cout <<
"Loading Isotropic Conductivity map." << endl;
224 const std::string varName =
"intensity";
231 if (
m_session->DefinesParameter(
"d_min") ||
239 for (
int j = 0; j < nq; ++j)
241 vTemp[j] = (vTemp[j] < f_min ? f_min : vTemp[j]);
242 vTemp[j] = (vTemp[j] > f_max ? f_max : vTemp[j]);
247 Vmath::Smul(nq, -1.0/(f_max-f_min), vTemp, 1, vTemp, 1);
249 Vmath::Smul(nq, scar_max - scar_min, vTemp, 1, vTemp, 1);
254 for (
int i = 0; i < nVarDiffCmpts; ++i)
267 for (
int i = 0; i < j + 1; ++i)
272 std::stringstream filename;
273 filename <<
"Conductivity_" << varCoeffString[k] <<
".fld";
284 LibUtilities::FilterMap::const_iterator x;
285 for (x = f.begin(); x != f.end(); ++x, ++k)
287 if (x->first ==
"CheckpointCellModel")
289 boost::shared_ptr<FilterCheckpointCellModel> c
294 if (x->first ==
"CellHistoryPoints")
296 boost::shared_ptr<FilterCellHistoryPoints> c
335 int nvariables = inarray.num_elements();
345 for (
int i = 0; i < nvariables; ++i)
362 outarray[i] =
m_fields[i]->GetPhys();
376 m_cell->TimeIntegrate(inarray, outarray, time);
379 for (
unsigned int i = 0; i <
m_stimulus.size(); ++i)
390 bool dumpInitialConditions,
394 dumpInitialConditions,
407 m_session->GetFunctionType(
"d00",
"intensity")
411 m_session->GetFunction(
"d00",
"intensity")->GetExpression());
414 m_session->GetFunctionType(
"d11",
"intensity")
418 m_session->GetFunction(
"d11",
"intensity")->GetExpression());
421 m_session->GetFunctionType(
"d22",
"intensity")
425 m_session->GetFunction(
"d22",
"intensity")->GetExpression());
427 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.
std::vector< std::pair< std::string, std::string > > SummaryList
StdRegions::VarCoeffMap m_vardiff
Variable diffusivity.
void SetCellModel(CellModelSharedPtr &pCellModel)
std::map< ConstFactorType, NekDouble > ConstFactorMap
void SetCellModel(CellModelSharedPtr &pCellModel)
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
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.
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.
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.
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.
virtual void v_SetInitialConditions(NekDouble initialtime, bool dumpInitialConditions, const int domain)
Sets a custom initial condition.
std::vector< FilterSharedPtr > m_filters
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.