MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / timeStepNoGUI

Method timeStepNoGUI

Simulator/SimulatorBase.cpp:959–1006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

957}
958
959bool SimulatorBase::timeStepNoGUI()
960{
961 const Real stopAt = getValue<Real>(SimulatorBase::STOP_AT);
962 if ((stopAt > 0.0) && (stopAt < TimeManager::getCurrent()->getTime()))
963 return false;
964
965 // Simulation code
966 Simulation *sim = Simulation::getCurrent();
967 const bool sim2D = sim->is2DSimulation();
968
969 START_TIMING("SimStep");
970 Simulation::getCurrent()->getTimeStep()->step();
971 STOP_TIMING_AVG;
972
973 m_boundarySimulator->timeStep();
974
975 step();
976
977 INCREASE_COUNTER("Time step size", TimeManager::getCurrent()->getTimeStepSize());
978
979 // Make sure that particles stay in xy-plane in a 2D simulation
980 if (sim2D)
981 {
982 for (unsigned int i = 0; i < sim->numberOfFluidModels(); i++)
983 {
984 FluidModel *model = sim->getFluidModel(i);
985 for (unsigned int i = 0; i < model->numActiveParticles(); i++)
986 {
987 model->getPosition(i)[2] = 0.0;
988 model->getVelocity(i)[2] = 0.0;
989 }
990 }
991 }
992
993#ifdef USE_DEBUG_TOOLS
994 Simulation::getCurrent()->getDebugTools()->step();
995#endif
996
997 if (m_timeStepCB)
998 m_timeStepCB();
999
1000#ifdef USE_EMBEDDED_PYTHON
1001 if (m_scriptObject)
1002 m_scriptObject->execStepFct();
1003#endif
1004
1005 return true;
1006}
1007
1008void SimulatorBase::updateScalarField()
1009{

Callers 1

Calls 13

getTimeMethod · 0.80
is2DSimulationMethod · 0.80
getTimeStepMethod · 0.80
numberOfFluidModelsMethod · 0.80
getFluidModelMethod · 0.80
numActiveParticlesMethod · 0.80
getVelocityMethod · 0.80
getDebugToolsMethod · 0.80
execStepFctMethod · 0.80
stepFunction · 0.50
stepMethod · 0.45
timeStepMethod · 0.45

Tested by

no test coverage detected