64 "Bidomain model of cardiac electrophysiology with 3D diffusion.");
82 std::string vCellModel;
83 m_session->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
85 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
97 std::string varName[3] = {
98 "AnisotropicConductivityX",
99 "AnisotropicConductivityY",
100 "AnisotropicConductivityZ"
104 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
109 Array<OneD,NekDouble> x0(nq);
110 Array<OneD,NekDouble> x1(nq);
111 Array<OneD,NekDouble> x2(nq);
115 tmp1 = Array<OneD, const Array<OneD, NekDouble> >(nq);
116 tmp2 = Array<OneD, const Array<OneD, NekDouble> >(nq);
117 tmp3 = Array<OneD, const Array<OneD, NekDouble> >(nq);
118 tmp1[i] = Array<OneD, NekDouble>(nq);
119 tmp2[i] = Array<OneD, NekDouble>(nq);
120 tmp3[i] = Array<OneD, NekDouble>(nq);
123 =
m_session->GetFunction(
"IntracellularConductivity", varName[i]);
125 =
m_session->GetFunction(
"ExtracellularConductivity", varName[i]);
126 for(
int j = 0; j < nq; j++)
128 tmp1[i][j] = ifunc1->Evaluate(x0[j],x1[j],x2[j],0.0);
129 tmp2[i][j] = ifunc2->Evaluate(x0[j],x1[j],x2[j],0.0);
131 Vmath::Vadd(nq, tmp1[i], 1, tmp2[i], 1, tmp3[i], 1);
138 if (
m_session->DefinesParameter(
"StimulusDuration"))
141 "Stimulus function not defined.");
154 LibUtilities::FilterMap::const_iterator x;
155 for (x = f.begin(); x != f.end(); ++x, ++k)
157 if (x->first ==
"CheckpointCellModel")
159 boost::shared_ptr<FilterCheckpointCellModel> c
190 const Array<
OneD,
const Array<OneD, NekDouble> >&inarray,
191 Array<
OneD, Array<OneD, NekDouble> >&outarray,
195 int nvariables = inarray.num_elements();
198 Array<OneD, NekDouble> grad0(nq), grad1(nq), grad2(nq), grad(nq);
199 Array<OneD, NekDouble> ggrad0(nq), ggrad1(nq), ggrad2(nq), ggrad(nq), temp(nq);
205 for (
int i = 0; i < nvariables; ++i)
209 Vmath::Vcopy(nq, &inarray[i][0], 1, &outarray[i][0], 1);
217 m_fields[i]->PhysDeriv(inarray[1],ggrad0);
219 m_fields[i]->PhysDeriv(0,ggrad0,ggrad0);
221 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
237 outarray[i] =
m_fields[i]->GetPhys();
242 m_fields[i]->PhysDeriv(inarray[1],ggrad0,ggrad1);
244 m_fields[i]->PhysDeriv(0,ggrad0,ggrad0);
245 m_fields[i]->PhysDeriv(1,ggrad1,ggrad1);
247 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
264 outarray[i] =
m_fields[i]->GetPhys();
269 m_fields[i]->PhysDeriv(inarray[1],ggrad0,ggrad1,ggrad2);
271 m_fields[i]->PhysDeriv(0,ggrad0,ggrad0);
272 m_fields[i]->PhysDeriv(1,ggrad1,ggrad1);
273 m_fields[i]->PhysDeriv(2,ggrad2,ggrad2);
275 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
294 outarray[i] =
m_fields[i]->GetPhys();
305 m_fields[i]->PhysDeriv(0,grad0,grad0);
307 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
320 outarray[i] =
m_fields[i]->GetPhys();
327 m_fields[i]->PhysDeriv(0,grad0,grad0);
328 m_fields[i]->PhysDeriv(1,grad1,grad1);
330 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
344 outarray[i] =
m_fields[i]->GetPhys();
351 m_fields[i]->PhysDeriv(0,grad0,grad0);
352 m_fields[i]->PhysDeriv(1,grad1,grad1);
353 m_fields[i]->PhysDeriv(2,grad2,grad2);
355 if (
m_session->DefinesFunction(
"IntracellularConductivity") &&
m_session->DefinesFunction(
"ExtracellularConductivity"))
371 outarray[i] =
m_fields[i]->GetPhys();
380 const Array<
OneD,
const Array<OneD, NekDouble> >&inarray,
381 Array<
OneD, Array<OneD, NekDouble> >&outarray,
385 m_cell->TimeIntegrate(inarray, outarray, time);
388 Array<OneD,NekDouble> x0(nq);
389 Array<OneD,NekDouble> x1(nq);
390 Array<OneD,NekDouble> x2(nq);
391 Array<OneD,NekDouble> result(nq);
397 =
m_session->GetFunction(
"Stimulus",
"u");
398 ifunc->Evaluate(x0,x1,x2,time, result);
400 Vmath::Vadd(nq, outarray[0], 1, result, 1, outarray[0], 1);
407 bool dumpInitialConditions,
422 ASSERTL0(
false,
"Update the generate summary");
468 m_cell->GenerateSummary(s);