| 122 | } |
| 123 | |
| 124 | void TimeStepPF::step() |
| 125 | { |
| 126 | Simulation *sim = Simulation::getCurrent(); |
| 127 | const unsigned int nModels = sim->numberOfFluidModels(); |
| 128 | TimeManager *tm = TimeManager::getCurrent (); |
| 129 | |
| 130 | for (unsigned int fluidModelIndex = 0; fluidModelIndex < nModels; fluidModelIndex++) |
| 131 | { |
| 132 | clearAccelerations(fluidModelIndex); |
| 133 | initialGuessForPositions(fluidModelIndex); |
| 134 | } |
| 135 | sim->performNeighborhoodSearch(); |
| 136 | |
| 137 | #ifdef USE_PERFORMANCE_OPTIMIZATION |
| 138 | precomputeValues(); |
| 139 | #endif |
| 140 | |
| 141 | if (sim->getBoundaryHandlingMethod() == BoundaryHandlingMethods::Bender2019) |
| 142 | computeVolumeAndBoundaryX(); |
| 143 | else if (sim->getBoundaryHandlingMethod() == BoundaryHandlingMethods::Koschier2017) |
| 144 | computeDensityAndGradient(); |
| 145 | |
| 146 | START_TIMING("solvePDConstraints"); |
| 147 | solvePDConstraints(); |
| 148 | STOP_TIMING_AVG; |
| 149 | |
| 150 | if (sim->getBoundaryHandlingMethod() == BoundaryHandlingMethods::Bender2019) |
| 151 | computeVolumeAndBoundaryX(); |
| 152 | else if (sim->getBoundaryHandlingMethod() == BoundaryHandlingMethods::Koschier2017) |
| 153 | computeDensityAndGradient(); |
| 154 | |
| 155 | for (unsigned int fluidModelIndex = 0; fluidModelIndex < nModels; fluidModelIndex++) |
| 156 | computeDensities(fluidModelIndex); |
| 157 | sim->computeNonPressureForces(); |
| 158 | addAccellerationToVelocity(); |
| 159 | |
| 160 | // update emitters |
| 161 | sim->emitParticles(); |
| 162 | sim->animateParticles(); |
| 163 | // Compute new time |
| 164 | sim->updateTimeStepSize(); |
| 165 | tm->setTime(tm->getTime () + tm->getTimeStepSize()); |
| 166 | } |
| 167 | |
| 168 | void TimeStepPF::reset() |
| 169 | { |
nothing calls this directly
no test coverage detected