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

Method clearAccelerations

SPlisHSPlasH/TimeStep.cpp:35–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void TimeStep::clearAccelerations(const unsigned int fluidModelIndex)
36{
37 Simulation *sim = Simulation::getCurrent();
38 FluidModel *model = sim->getFluidModel(fluidModelIndex);
39 const unsigned int count = model->numActiveParticles();
40 const Vector3r grav(sim->getVecValue<Real>(Simulation::GRAVITATION));
41 for (unsigned int i=0; i < count; i++)
42 {
43 // Clear accelerations of dynamic particles
44 Vector3r& a = model->getAcceleration(i);
45 if ((model->getMass(i) != 0.0) && (model->getParticleState(i) == ParticleState::Active))
46 {
47 a = grav;
48 }
49 else
50 {
51 a.setZero();
52 }
53 }
54}
55
56#ifdef USE_AVX
57

Callers

nothing calls this directly

Calls 4

getFluidModelMethod · 0.80
numActiveParticlesMethod · 0.80
getMassMethod · 0.45
setZeroMethod · 0.45

Tested by

no test coverage detected