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

Method step

SPlisHSPlasH/PF/TimeStepPF.cpp:124–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void 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
168void TimeStepPF::reset()
169{

Callers

nothing calls this directly

Calls 12

precomputeValuesFunction · 0.85
computeDensitiesFunction · 0.85
numberOfFluidModelsMethod · 0.80
animateParticlesMethod · 0.80
updateTimeStepSizeMethod · 0.80
getTimeMethod · 0.80
emitParticlesMethod · 0.45
setTimeMethod · 0.45
getTimeStepSizeMethod · 0.45

Tested by

no test coverage detected