//inner product definition from Corollary 4.2, "Mimetic scalar products of differential forms" by Brezzi et al
// formula (5.31)
IP=R*(R.Transpose()*N).Invert().first*R.Transpose();// Consistency part
IP+=(rMatrix::Unit(NF)-N*(N.Transpose()*N).Invert().first*N.Transpose())*(2.0/static_cast<real>(NF)*IP.Trace());//Stability part
// formula (5.32)
IP+=(rMatrix::Unit(NF)-N*(N.Transpose()*N).Invert().first*N.Transpose())*(1.0/(static_cast<real>(NF)*vP)*(R*K.Invert().first*R.Transpose()).Trace());//Stability part
//assert(IP.isSymmetric()); //test positive definitiness as well!
/*
if(!IP.isSymmetric())
{
std::cout<<"unsymmetric"<<std::endl;
...
...
@@ -202,7 +209,7 @@ int main(int argc,char ** argv)
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
...
...
@@ -217,6 +224,8 @@ int main(int argc,char ** argv)
realxP[3];//center of the cell
realyF[3];//center of the face
realnF[3];//normal to the face
realaF;//area of the face
realvP=cell->Volume();//volume of the cell
cell->Centroid(xP);
ElementArray<Face>faces=cell->getFaces();//obtain faces of the cell
intNF=(int)faces.size();//number of faces;
...
...
@@ -229,21 +238,22 @@ int main(int argc,char ** argv)