Vardan,

Numbers swapped? Hm what do you mean?

Actually, my code looks like this now, much cleaner

for(int i=0; i<m_tetrahedrons.size(); ++i)
    {
        btTetrahedron* t = m_tetrahedrons[i];
        t->computeCorotatedStiffness();

        for(unsigned int j=0; j<12; ++j)
        {
            int jj = t->getGlobalIndex(j);

            for(unsigned int k=0; k<12; ++k)
            {
                int kk = t->getGlobalIndex(k);

                m_RKR_1(jj, kk) += t->getCorotatedStiffness0(j, k);
                m_RK(jj, kk) += t->getCorotatedStiffness1(j, k);
            }
        }
    }

If I change to +=1 I get the same performance. Also, if I comment only one of these lines, m_RK(jj, kk)) += ... for example, I get exactly x2 speed up. Oh well...

Thanks for you time and help.


x