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

Function computeF

Tools/MeshSkinning/main.cpp:687–725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

685#ifdef USE_AVX
686
687void computeF()
688{
689 const int numParticles = (int)activeParticles.size();
690
691 #pragma omp parallel default(shared)
692 {
693 #pragma omp for schedule(static)
694 for (int i = 0; i < (int)numParticles; i++)
695 {
696 const unsigned int index = activeParticles[i];
697 const Vector3r &xi = x[index];
698 const Vector3r& xi0 = x0[index];
699
700 const Vector3f8 xi_avx(xi);
701 const Vector3f8 xi0_avx(xi0);
702
703 const unsigned int numNeighbors = (unsigned int) initialNeighbors[index].size();
704
705 Matrix3f8 F_avx;
706 F_avx.setZero();
707 for (unsigned int j = 0; j < numNeighbors; j += 8)
708 {
709 const unsigned int count = std::min(numNeighbors - j, 8u);
710
711 const Vector3f8 xj_avx = convertVec_zero(&initialNeighbors[index][j], &x[0], count);
712 const Vector3f8 xj_xi = xj_avx - xi_avx;
713 const Vector3f8& V_gradW = precomp_V_gradW8[precomputed_indices8[i] + j / 8];
714
715 const Scalarf8 restVolume_j_avx = convert_zero(&initialNeighbors[index][j], &restVolumes[0], count);
716 const Vector3f8 xj0_avx = convertVec_zero(&initialNeighbors[index][j], &x0[0], count);
717 //const Vector3f8& V_gradW = Matrix3f8(L[index]) * CubicKernel_AVX::gradW(xi0_avx - xj0_avx) * restVolume_j_avx;
718 Matrix3f8 dyad;
719 dyadicProduct(xj_xi, V_gradW, dyad);
720 F_avx += dyad;
721 }
722 F[index] = F_avx.reduce();
723 }
724 }
725}
726
727
728void deformMesh()

Callers 2

computeRHSMethod · 0.85
meshSkinningFunction · 0.85

Calls 8

minFunction · 0.85
convertVec_zeroFunction · 0.85
convert_zeroFunction · 0.85
dyadicProductFunction · 0.85
sizeMethod · 0.45
setZeroMethod · 0.45
reduceMethod · 0.45
transposeMethod · 0.45

Tested by

no test coverage detected