sandbox/yonghui/smalltest/output

    It’s a remanding page of code to output data * /

    output image & video

    output_ppm (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_field ((scalar *){u}, fopen ("velo_3D", "w"), N, linear = true);
    
    output_facets (f, stderr); //in log 
    
    scalar l[];
    foreach()
      l[] = level;
    output_field ({l}, stdout, N);
    
    
    clear();//view.h
    view (fov = 27.1723, quat = {-0.707795,-0.108707,-0.69171,0.0934929}, 
          tx = -0.545947, ty = -0.00320332, bg = {0.3,0.4,0.6}, width = 640, height = 320);
    box();
    isosurface ("d", color = "level", min = 5, max = 10);
    squares("u.x", linear = true, min =0, max =0.25);
    draw_vof("f");
    save("view_3D.png");
    
    char legend[1000]; //time
    sprintf(legend, "t = %0.2g", t);
    draw_string(legend, 1, size = 30., lw = 2.);

    data file

    FILE * fp1;
    fp1 = fopen ("name", "w");
    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.;
      uu = interpolate(u.x , xx, yy);
      vv = interpolate(u.y , xx, yy);
      pp = interpolate(p , xx, yy);
      fprintf(fp2,"%g %g %g %g %g\n", t, xx, uu, vv, pp);
    }