9 int main(
int argc,
char *argv[])
14 std::string vCellModel;
16 std::vector<StimulusSharedPtr> vStimulus;
24 vSession = LibUtilities::SessionReader::CreateInstance(argc, argv);
25 vSession->InitSession();
36 vSession->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
37 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
40 vCellModel, vSession, vExp);
44 vStimulus = Stimulus::LoadStimuli(vSession, vExp);
49 vDeltaT = vSession->GetParameter(
"TimeStep");
51 nSteps = vSession->GetParameter(
"NumSteps");
54 vSession->GetFunction(
"InitialConditions",
"u");
55 vSol[0][0] = e->Evaluate(0.0, 0.0, 0.0, 0.0);
58 for (
unsigned int i = 0; i < vCell->GetNumCellVariables(); ++i)
60 cout <<
" " << vCell->GetCellVarName(i);
65 for (
unsigned int i = 0; i < nSteps; ++i)
68 vCell->TimeIntegrate(vSol, vWsp, vTime);
71 for (
unsigned int i = 0; i < vStimulus.size(); ++i)
73 vStimulus[i]->Update(vWsp, vTime);
77 Vmath::Svtvp(1, vDeltaT, vWsp[0], 1, vSol[0], 1, vSol[0], 1);
83 cout << vTime <<
" " << vSol[0][0];
84 for (
unsigned int j = 0; j < vCell->GetNumCellVariables(); ++j)
86 cout <<
" " << vCell->GetCellSolution(j)[0];
91 for (
unsigned int i = 0; i < vCell->GetNumCellVariables(); ++i)
93 cout <<
"# " << vCell->GetCellVarName(i) <<
" " 94 << vCell->GetCellSolution(i)[0] << endl;
99 cerr <<
"An error occured" << endl;
#define ASSERTL0(condition, msg)
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
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
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
int main(int argc, char *argv[])
std::shared_ptr< CellModel > CellModelSharedPtr
A shared pointer to an EquationSystem object.
std::shared_ptr< PointGeom > PointGeomSharedPtr
CellModelFactory & GetCellModelFactory()
std::shared_ptr< Equation > EquationSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr