Post date: 2017/04/19 15:05:51 ( Update: 2020-08-18 )
fespace Vh2(Th,[P1,P1]);
Vh2 [u1,u2];
fespace Vh1(Th,P1);
Vh1 v;
{
ofstream ff("out.dat");
for(int i=0; i<Th.nt; i++) {
ff << Th.nt ;
for(int j=0; j<3; j++) {
ff<< ", "<< Th[i][j].x + u1[][Vh2(i,j)];
ff<< ", "<< Th[i][j].y + u1[][Vh2(i,j)+1]; // u2[]
}
for(int j=0; j<3; j++) ff << ", " << v[][Vh1(i,j)];
ff<< endl;
}
}
出力結果:
n_triangle, x_1+u1_1, y_1+u2_1, x2+u1_2, y2+u2_2, x3+u1_3, y3+u2_3, v_1, v_2, v_3
fespace Vh2(Th,[P1,P1]);
Vh2 [u1,u2];
fespace Vh1(Th,P1);
Vh1 v;
{
ofstream ff("out.dat");
for(int i=0; i<Th.nv; i++) {
ff << Th(i).x + u1[][2*i];
ff << ", " << Th(i).y + u1[][2*i+1]; // u2[]
ff << ", " << v[][i];
ff << endl;
}
}
出力結果:
n_vertex, x+u1, y+u2, v
Ref: