sandbox/yonghui/smalltest/output
It’s a remanding page of code to output data * /
output image & video
(u.x, file = "name.png", linear = true,n=512,min=-1.,max=1.);
output_ppm
(u.x, file = "name.mp4", linear = true,n=512,min=-1.,max=1.);
output_ppm
((scalar *){u}, fopen ("velo_3D", "w"), N, linear = true);
output_field
(f, stderr); //in log
output_facets
scalar l[];
foreach()
[] = level;
l({l}, stdout, N);
output_field
();//view.h
clear(fov = 27.1723, quat = {-0.707795,-0.108707,-0.69171,0.0934929},
view = -0.545947, ty = -0.00320332, bg = {0.3,0.4,0.6}, width = 640, height = 320);
tx ();
box("d", color = "level", min = 5, max = 10);
isosurface ("u.x", linear = true, min =0, max =0.25);
squares("f");
draw_vof("view_3D.png");
save
char legend[1000]; //time
sprintf(legend, "t = %0.2g", t);
(legend, 1, size = 30., lw = 2.); draw_string
data file
FILE * fp1;
= fopen ("name", "w");
fp1 fprintf(fp1,"%d %g %g %g\n" , i, t, dt, interpolate(u.x, L0/2., L0/2.));
fprintf(stderr,"%d %g\n",i,t); //log
fprintf(stdout,"%d %g\n",i,t); //out
##for loop
for (double xx = 0.; xx <= 1.; xx += 1./100. ){
double yy = L0/2.;
= interpolate(u.x , xx, yy);
uu = interpolate(u.y , xx, yy);
vv = interpolate(p , xx, yy);
pp fprintf(fp2,"%g %g %g %g %g\n", t, xx, uu, vv, pp);
}