43int main(
int argc,
char *argv[])
48 std::string vCellModel;
50 std::vector<StimulusSharedPtr> vStimulus;
58 vSession = LibUtilities::SessionReader::CreateInstance(argc, argv);
59 vSession->InitSession();
69 vSession->LoadSolverInfo(
"CELLMODEL", vCellModel,
"");
70 ASSERTL0(vCellModel !=
"",
"Cell Model not specified.");
77 vStimulus = Stimulus::LoadStimuli(vSession, vExp);
82 vDeltaT = vSession->GetParameter(
"TimeStep");
84 nSteps = vSession->GetParameter(
"NumSteps");
87 vSession->GetFunction(
"InitialConditions",
"u");
88 vSol[0][0] = e->Evaluate(0.0, 0.0, 0.0, 0.0);
91 for (
unsigned int i = 0; i < vCell->GetNumCellVariables(); ++i)
93 cout <<
" " << vCell->GetCellVarName(i);
98 for (
unsigned int i = 0; i < nSteps; ++i)
101 vCell->TimeIntegrate(vSol, vWsp, vTime);
104 for (
unsigned int i = 0; i < vStimulus.size(); ++i)
106 vStimulus[i]->Update(vWsp, vTime);
110 Vmath::Svtvp(1, vDeltaT, vWsp[0], 1, vSol[0], 1, vSol[0], 1);
116 cout << vTime <<
" " << vSol[0][0];
117 for (
unsigned int j = 0; j < vCell->GetNumCellVariables(); ++j)
119 cout <<
" " << vCell->GetCellSolution(j)[0];
124 for (
unsigned int i = 0; i < vCell->GetNumCellVariables(); ++i)
126 cout <<
"# " << vCell->GetCellVarName(i) <<
" "
127 << vCell->GetCellSolution(i)[0] << endl;
132 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
The above copyright notice and this permission notice shall be included.
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