| 957 | } |
| 958 | |
| 959 | bool 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 | |
| 1008 | void SimulatorBase::updateScalarField() |
| 1009 | { |
no test coverage detected