// -*- FreeFem++ -*- // Sample of SaveHB mesh Th = square(3,3); macro Grad(u) [dx(u),dy(u)] // EOM varf vP(u,v) = int2d(Th)(Grad(u)'*Grad(v)) + int2d(Th)(v) + on(1,u=1); fespace Vh(Th,P1); //Vh u,v; //problem vP(u,v) = int2d(Th)(Grad(u)'*Grad(v)) + int2d(Th)(v) + on(1,u=1); //vP; matrix A = vP(Vh,Vh); real[int] rhs = vP(0,Vh); load "SaveHB" int ret = SaveHB("sample.hb", A, rhs, "sample of SaveHB"); assert(ret == 0); //cout << " A = " << A << endl; //cout << " rhs = " << rhs << endl; //---------------------------------------------------------------- //Vh u = A^-1*rhs; //plot(u); //real[int] v = A^-1*rhs; //cout << " v = " << v << endl; // End of file