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

Method step

SPlisHSPlasH/IISPH/TimeStepIISPH.cpp:92–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void 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
141void TimeStepIISPH::reset()

Callers

nothing calls this directly

Calls 12

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

Tested by

no test coverage detected