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

Method init

SPlisHSPlasH/PBF/SimulationDataPBF.cpp:20–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20void SimulationDataPBF::init()
21{
22 Simulation *sim = Simulation::getCurrent();
23 const unsigned int nModels = sim->numberOfFluidModels();
24
25 m_lambda.resize(nModels);
26 m_deltaX.resize(nModels);
27 m_oldX.resize(nModels);
28 m_lastX.resize(nModels);
29 for (unsigned int i = 0; i < nModels; i++)
30 {
31 FluidModel *fm = sim->getFluidModel(i);
32 m_lambda[i].resize(fm->numParticles(), 0.0);
33 m_deltaX[i].resize(fm->numParticles(), Vector3r::Zero());
34 m_oldX[i].resize(fm->numParticles(), Vector3r::Zero());
35 m_lastX[i].resize(fm->numParticles(), Vector3r::Zero());
36 }
37 reset();
38}
39
40void SimulationDataPBF::cleanup()
41{

Callers 2

TimeStepPBFMethod · 0.45
resizeMethod · 0.45

Calls 5

numberOfFluidModelsMethod · 0.80
getFluidModelMethod · 0.80
numParticlesMethod · 0.80
resetFunction · 0.50
resizeMethod · 0.45

Tested by

no test coverage detected