13 std::string vCellModel;
15 std::vector<StimulusSharedPtr> vStimulus;
23 vSession = LibUtilities::SessionReader::CreateInstance(argc, argv);
34 vSession->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
35 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
38 vCellModel, vSession, vExp);
42 vStimulus = Stimulus::LoadStimuli(vSession, vExp);
47 vDeltaT = vSession->GetParameter(
"TimeStep");
49 nSteps = vSession->GetParameter(
"NumSteps");
52 vSession->GetFunction(
"InitialConditions",
"u");
53 vSol[0][0] = e->Evaluate(0.0, 0.0, 0.0, 0.0);
56 for (
unsigned int i = 0; i < vCell->GetNumCellVariables(); ++i)
58 cout <<
" " << vCell->GetCellVarName(i);
63 for (
unsigned int i = 0; i < nSteps; ++i)
66 vCell->TimeIntegrate(vSol, vWsp, vTime);
69 for (
unsigned int i = 0; i < vStimulus.size(); ++i)
71 vStimulus[i]->Update(vWsp, vTime);
75 Vmath::Svtvp(1, vDeltaT, vWsp[0], 1, vSol[0], 1, vSol[0], 1);
81 cout << vTime <<
" " << vSol[0][0];
82 for (
unsigned int j = 0; j < vCell->GetNumCellVariables(); ++j)
84 cout <<
" " << vCell->GetCellSolution(j)[0];
89 for (
unsigned int i = 0; i < vCell->GetNumCellVariables(); ++i)
91 cout <<
"# " << vCell->GetCellVarName(i) <<
" "
92 << vCell->GetCellSolution(i)[0] << endl;
97 cerr <<
"An error occured" << endl;
#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.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
boost::shared_ptr< CellModel > CellModelSharedPtr
A shared pointer to an EquationSystem object.
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
boost::shared_ptr< Equation > EquationSharedPtr
CellModelFactory & GetCellModelFactory()
boost::shared_ptr< PointGeom > PointGeomSharedPtr