void AbstractCellCycleModelOdeSolver::SolveAndUpdateStateVariable(AbstractOdeSystem* pAbstractOdeSystem,
                                                                  double startTime,
                                                                  double endTime,
                                                                  double timeStep)
{
    assert(IsSetUp());
    mpOdeSolver->SolveAndUpdateStateVariable(pAbstractOdeSystem, startTime, endTime, timeStep);
}
void AbstractCellCycleModelOdeSolver::SetMaxSteps(long int numSteps)
{
#ifdef CHASTE_CVODE
    assert(IsSetUp());
    if (boost::dynamic_pointer_cast<CvodeAdaptor>(mpOdeSolver))
    {
        (boost::static_pointer_cast<CvodeAdaptor>(mpOdeSolver))->SetMaxSteps(numSteps);
    }
#endif //CHASTE_CVODE
}
void AbstractCellCycleModelOdeSolver::CheckForStoppingEvents()
{
#ifdef CHASTE_CVODE
    assert(IsSetUp());
    if (boost::dynamic_pointer_cast<CvodeAdaptor>(mpOdeSolver))
    {
        (boost::static_pointer_cast<CvodeAdaptor>(mpOdeSolver))->CheckForStoppingEvents();
    }
#endif //CHASTE_CVODE
}
void AbstractCellCycleModelOdeSolver::SetTolerances(double relTol, double absTol)
{
#ifdef CHASTE_CVODE
    assert(IsSetUp());
    if (boost::dynamic_pointer_cast<CvodeAdaptor>(mpOdeSolver))
    {
        (boost::static_pointer_cast<CvodeAdaptor>(mpOdeSolver))->SetTolerances(relTol, absTol);
    }
#endif //CHASTE_CVODE
}
bool AbstractCellCycleModelOdeSolver::IsAdaptive()
{
    bool adaptive = false;
#ifdef CHASTE_CVODE
    assert(IsSetUp());
    if (boost::dynamic_pointer_cast<CvodeAdaptor>(mpOdeSolver))
    {
        adaptive = true;
    }
#endif //CHASTE_CVODE
    return adaptive;
}
Example #6
0
	void Universe::Start()
	{
		// TODO(dot): log this.
		if(!IsSetUp())
			return;
		
		running = true;
		paused = false;

		world->PreInit();
		world->Init();
		world->PostInit();

		// TODO(dot): move step out of local var.
		float dt, buffer = 0, step = 1 / 60.f;
		sf::Clock timer;
		while(IsRunning())
		{
			dt = timer.restart().asSeconds();
			buffer += dt;
			sf::Event ev;
			while(window->pollEvent(ev))
			{
				world->HandleEvent(ev);
				if(ev.type == sf::Event::Closed)
				{
					Stop();
					break;
				}
			}

			while(buffer > step)
			{
				world->Step(step);
				physicsWorld->Step(step, 8, 3);
				buffer -= step;
			}

			world->Update(dt);

			window->clear();
            world->Draw(window);
			window->display();
		}
	}
double AbstractCellCycleModelOdeSolver::GetStoppingTime()
{
    assert(IsSetUp());
    return mpOdeSolver->GetStoppingTime();
}
bool AbstractCellCycleModelOdeSolver::StoppingEventOccurred()
{
    assert(IsSetUp());
    return mpOdeSolver->StoppingEventOccurred();
}