| 90 | } |
| 91 | |
| 92 | void TimeStepIISPH::step() |
| 93 | { |
| 94 | Simulation *sim = Simulation::getCurrent(); |
| 95 | TimeManager *tm = TimeManager::getCurrent (); |
| 96 | const Real h = tm->getTimeStepSize(); |
| 97 | const unsigned int nModels = sim->numberOfFluidModels(); |
| 98 | |
| 99 | for (unsigned int fluidModelIndex = 0; fluidModelIndex < nModels; fluidModelIndex++) |
| 100 | clearAccelerations(fluidModelIndex); |
| 101 | |
| 102 | sim->performNeighborhoodSearch(); |
| 103 | |
| 104 | #ifdef USE_PERFORMANCE_OPTIMIZATION |
| 105 | precomputeValues(); |
| 106 | #endif |
| 107 | |
| 108 | if (sim->getBoundaryHandlingMethod() == BoundaryHandlingMethods::Bender2019) |
| 109 | computeVolumeAndBoundaryX(); |
| 110 | else if (sim->getBoundaryHandlingMethod() == BoundaryHandlingMethods::Koschier2017) |
| 111 | computeDensityAndGradient(); |
| 112 | |
| 113 | for (unsigned int fluidModelIndex = 0; fluidModelIndex < nModels; fluidModelIndex++) |
| 114 | computeDensities(fluidModelIndex); |
| 115 | |
| 116 | sim->computeNonPressureForces(); |
| 117 | |
| 118 | sim->updateTimeStepSize(); |
| 119 | |
| 120 | // Solve density constraint |
| 121 | START_TIMING("predictAdvection"); |
| 122 | for (unsigned int fluidModelIndex = 0; fluidModelIndex < nModels; fluidModelIndex++) |
| 123 | predictAdvection(fluidModelIndex); |
| 124 | STOP_TIMING_AVG; |
| 125 | |
| 126 | START_TIMING("pressureSolve"); |
| 127 | pressureSolve(); |
| 128 | STOP_TIMING_AVG; |
| 129 | |
| 130 | for (unsigned int fluidModelIndex = 0; fluidModelIndex < nModels; fluidModelIndex++) |
| 131 | integration(fluidModelIndex); |
| 132 | |
| 133 | sim->emitParticles(); |
| 134 | sim->animateParticles(); |
| 135 | |
| 136 | // Compute new time |
| 137 | tm->setTime (tm->getTime () + h); |
| 138 | } |
| 139 | |
| 140 | |
| 141 | void TimeStepIISPH::reset() |
nothing calls this directly
no test coverage detected