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

Method step

SPlisHSPlasH/DFSPH/TimeStepDFSPH.cpp:117–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void TimeStepDFSPH::step()
118{
119 Simulation *sim = Simulation::getCurrent();
120 TimeManager *tm = TimeManager::getCurrent ();
121 const Real h = tm->getTimeStepSize();
122 const unsigned int nModels = sim->numberOfFluidModels();
123
124 //////////////////////////////////////////////////////////////////////////
125 // search the neighbors for all particles
126 //////////////////////////////////////////////////////////////////////////
127 sim->performNeighborhoodSearch();
128
129#ifdef USE_PERFORMANCE_OPTIMIZATION
130 //////////////////////////////////////////////////////////////////////////
131 // precompute the values V_j * grad W_ij for all neighbors
132 //////////////////////////////////////////////////////////////////////////
133 START_TIMING("precomputeValues")
134 precomputeValues();
135 STOP_TIMING_AVG
136#endif
137
138 //////////////////////////////////////////////////////////////////////////
139 // compute volume/density maps boundary contribution
140 //////////////////////////////////////////////////////////////////////////
141 if (sim->getBoundaryHandlingMethod() == BoundaryHandlingMethods::Bender2019)
142 computeVolumeAndBoundaryX();
143 else if (sim->getBoundaryHandlingMethod() == BoundaryHandlingMethods::Koschier2017)
144 computeDensityAndGradient();
145
146 //////////////////////////////////////////////////////////////////////////
147 // compute densities
148 //////////////////////////////////////////////////////////////////////////
149 for (unsigned int fluidModelIndex = 0; fluidModelIndex < nModels; fluidModelIndex++)
150 computeDensities(fluidModelIndex);
151
152 //////////////////////////////////////////////////////////////////////////
153 // Compute the factor alpha_i for all particles i
154 // using the equation (11) in [BK17]
155 //////////////////////////////////////////////////////////////////////////
156 START_TIMING("computeDFSPHFactor");
157 for (unsigned int fluidModelIndex = 0; fluidModelIndex < nModels; fluidModelIndex++)
158 computeDFSPHFactor(fluidModelIndex);
159 STOP_TIMING_AVG;
160
161 //////////////////////////////////////////////////////////////////////////
162 // Perform divergence solve (see Algorithm 2 in [BK17])
163 //////////////////////////////////////////////////////////////////////////
164 if (m_enableDivergenceSolver)
165 {
166 START_TIMING("divergenceSolve");
167 divergenceSolve();
168 STOP_TIMING_AVG
169 }
170 else
171 m_iterationsV = 0;
172
173 //////////////////////////////////////////////////////////////////////////
174 // Reset accelerations and add gravity

Callers

nothing calls this directly

Calls 15

precomputeValuesFunction · 0.85
computeDensitiesFunction · 0.85
numberOfFluidModelsMethod · 0.80
updateTimeStepSizeMethod · 0.80
getFluidModelMethod · 0.80
numActiveParticlesMethod · 0.80
getVelocityMethod · 0.80
animateParticlesMethod · 0.80
getTimeMethod · 0.80

Tested by

no test coverage detected