IP=R*(R.Transpose()*N).Invert(true).first*R.Transpose();// Consistency part
// formula (5.32)
IP+=(rMatrix::Unit(NF)-N*(N.Transpose()*N).Invert(true).first*N.Transpose())*(2.0/(static_cast<real>(NF)*vP)*(R*K.Invert(true).first*R.Transpose()).Trace());//Stability part
//assert(IP.isSymmetric()); //test positive definitiness as well!
/*
if( !IP.isSymmetric() )
{
std::cout << "unsymmetric" << std::endl;
IP.Print();
std::cout << "check" << std::endl;
(IP-IP.Transpose()).Print();
}
*/
real_arrayM=cell->RealArrayDV(tag_M);//access data structure for inner product matrix in mesh
M.resize(NF*NF);//resize variable array
std::copy(IP.data(),IP.data()+NF*NF,M.data());//write down the inner product matrix