62 string Bidomain::className
66 "Bidomain model of cardiac electrophysiology with 3D diffusion.");
84 std::string vCellModel;
85 m_session->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
87 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
99 std::string varName[3] = {
100 "AnisotropicConductivityX",
101 "AnisotropicConductivityY",
102 "AnisotropicConductivityZ"
106 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
125 =
m_session->GetFunction(
"IntracellularConductivity", varName[i]);
127 =
m_session->GetFunction(
"ExtracellularConductivity", varName[i]);
128 for(
int j = 0; j < nq; j++)
130 tmp1[i][j] = ifunc1->Evaluate(x0[j],x1[j],x2[j],0.0);
131 tmp2[i][j] = ifunc2->Evaluate(x0[j],x1[j],x2[j],0.0);
133 Vmath::Vadd(nq, tmp1[i], 1, tmp2[i], 1, tmp3[i], 1);
140 if (
m_session->DefinesParameter(
"StimulusDuration"))
143 "Stimulus function not defined.");
156 LibUtilities::FilterMap::const_iterator x;
157 for (x = f.begin(); x != f.end(); ++x, ++k)
159 if (x->first ==
"CheckpointCellModel")
161 boost::shared_ptr<FilterCheckpointCellModel> c
197 int nvariables = inarray.num_elements();
207 for (
int i = 0; i < nvariables; ++i)
211 Vmath::Vcopy(nq, &inarray[i][0], 1, &outarray[i][0], 1);
219 m_fields[i]->PhysDeriv(inarray[1],ggrad0);
221 m_fields[i]->PhysDeriv(0,ggrad0,ggrad0);
223 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
239 outarray[i] =
m_fields[i]->GetPhys();
244 m_fields[i]->PhysDeriv(inarray[1],ggrad0,ggrad1);
246 m_fields[i]->PhysDeriv(0,ggrad0,ggrad0);
247 m_fields[i]->PhysDeriv(1,ggrad1,ggrad1);
249 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
266 outarray[i] =
m_fields[i]->GetPhys();
271 m_fields[i]->PhysDeriv(inarray[1],ggrad0,ggrad1,ggrad2);
273 m_fields[i]->PhysDeriv(0,ggrad0,ggrad0);
274 m_fields[i]->PhysDeriv(1,ggrad1,ggrad1);
275 m_fields[i]->PhysDeriv(2,ggrad2,ggrad2);
277 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
296 outarray[i] =
m_fields[i]->GetPhys();
307 m_fields[i]->PhysDeriv(0,grad0,grad0);
309 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
322 outarray[i] =
m_fields[i]->GetPhys();
329 m_fields[i]->PhysDeriv(0,grad0,grad0);
330 m_fields[i]->PhysDeriv(1,grad1,grad1);
332 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
346 outarray[i] =
m_fields[i]->GetPhys();
353 m_fields[i]->PhysDeriv(0,grad0,grad0);
354 m_fields[i]->PhysDeriv(1,grad1,grad1);
355 m_fields[i]->PhysDeriv(2,grad2,grad2);
357 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
373 outarray[i] =
m_fields[i]->GetPhys();
387 m_cell->TimeIntegrate(inarray, outarray, time);
399 =
m_session->GetFunction(
"Stimulus",
"u");
400 ifunc->Evaluate(x0,x1,x2,time, result);
402 Vmath::Vadd(nq, outarray[0], 1, result, 1, outarray[0], 1);
409 bool dumpInitialConditions,
424 ASSERTL0(
false,
"Update the generate summary");
470 m_cell->GenerateSummary(s);
#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)
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
std::vector< std::pair< std::string, std::string > > SummaryList
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 SetCellModel(CellModelSharedPtr &pCellModel)
std::map< ConstFactorType, NekDouble > ConstFactorMap
virtual ~Bidomain()
Desctructor.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s)
Print a summary of time stepping parameters.
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)
StdRegions::VarCoeffMap m_vardiffie
NekDouble m_stimDuration
Stimulus current.
virtual void v_GenerateSummary(SummaryList &s)
Prints a summary of the model parameters.
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.
virtual void v_SetInitialConditions(NekDouble initialtime, bool dumpInitialConditions, const int domain)
Sets a custom initial condition.
boost::shared_ptr< Equation > EquationSharedPtr
StdRegions::VarCoeffMap m_vardiffi
EquationSystemFactory & GetEquationSystemFactory()
CellModelFactory & GetCellModelFactory()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
CellModelSharedPtr m_cell
Cell model.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
std::vector< FilterSharedPtr > m_filters
virtual void v_InitObject()
Init object for UnsteadySystem class.
Array< OneD, Array< OneD, NekDouble > > tmp1
Array< OneD, Array< OneD, NekDouble > > tmp2
Array< OneD, Array< OneD, NekDouble > > tmp3
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
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 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.
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.