Exporting boundary value

I would just use something like the following (based on this post):

fespace Vh(Th, [P2,P2,P2,P1]);
Vh [ux, uy, uz, p];
Vh [xx, xy, xz, xp] = [x,x,x,x];
Vh [yx, yy, yz, yp] = [y,y,y,y];
varf vBC1([u1, u2, u3, p], [v1, v2, v3, q])  = 
            on(1, u1 = 1.); // variational formulation to set the values corresponding to the velocity x at label1 to 1
real[int] bcLab1vec = vBC1(0,Vh,tgv=-1); 
for(int i=0; i< bcLab1vec .n; i++) {
    if(abs(bcLab1vec[i]-1)<1e-10)
         file1 << xx[][i]<< " " << yx[][i] << " " << ux[][i] << endl;
}

1 Like