42int main(
int argc,
char *argv[])
47 std::string vCellModel;
49 std::vector<StimulusSharedPtr> vStimulus;
57 vSession = LibUtilities::SessionReader::CreateInstance(argc, argv);
58 vSession->InitSession();
68 vSession->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
69 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
76 vStimulus = Stimulus::LoadStimuli(vSession, vExp);
81 vDeltaT = vSession->GetParameter(
"TimeStep");
83 nSteps = vSession->GetParameter(
"NumSteps");
86 vSession->GetFunction(
"InitialConditions",
"u");
87 vSol[0][0] = e->Evaluate(0.0, 0.0, 0.0, 0.0);
90 for (
unsigned int i = 0; i < vCell->GetNumCellVariables(); ++i)
92 cout <<
" " << vCell->GetCellVarName(i);
97 for (
unsigned int i = 0; i < nSteps; ++i)
100 vCell->TimeIntegrate(vSol, vWsp, vTime);
103 for (
unsigned int i = 0; i < vStimulus.size(); ++i)
105 vStimulus[i]->Update(vWsp, vTime);
109 Vmath::Svtvp(1, vDeltaT, vWsp[0], 1, vSol[0], 1, vSol[0], 1);
115 cout << vTime <<
" " << vSol[0][0];
116 for (
unsigned int j = 0; j < vCell->GetNumCellVariables(); ++j)
118 cout <<
" " << vCell->GetCellSolution(j)[0];
123 for (
unsigned int i = 0; i < vCell->GetNumCellVariables(); ++i)
125 cout <<
"# " << vCell->GetCellVarName(i) <<
" "
126 << vCell->GetCellSolution(i)[0] << endl;
131 cerr <<
"An error occured" << endl;
#define ASSERTL0(condition, msg)
int main(int argc, char *argv[])
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
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...
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Equation > EquationSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< PointGeom > PointGeomSharedPtr
CellModelFactory & GetCellModelFactory()
std::shared_ptr< CellModel > CellModelSharedPtr
A shared pointer to an EquationSystem object.
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.