Debian Codegraph @

docs/formats/uhbd.rst

raw
1 UHBD scalar data format
2 =======================
3
4 We also support scalar data output in the legacy "UHBD format" for use with programs such as `UHBD <http://browndye.ucsd.edu/>`_ and `SDA <https://mcm.h-its.org/sda/>`_.
5
6 UHBD data is written in the format:
7
8 .. code-block:: c
9
10 /* Write out the header */
11 Vio_printf(sock, "%72s\n", title);
12 Vio_printf(sock, "%12.5e%12.5e%7d%7d%7d%7d%7d\n", 1.0, 0.0, -1, 0,
13 nz, 1, nz);
14 Vio_printf(sock, "%7d%7d%7d%12.5e%12.5e%12.5e%12.5e\n", nx, ny, nz,
15 hx, (xmin-hx), (ymin-hx), (zmin-hx));
16 Vio_printf(sock, "%12.5e%12.5e%12.5e%12.5e\n", 0.0, 0.0, 0.0, 0.0);
17 Vio_printf(sock, "%12.5e%12.5e%7d%7d", 0.0, 0.0, 0, 0);
18
19 /* Write out the entries */
20 icol = 0;
21 for (k=0; k<nz; k++) {
22 Vio_printf(sock, "\n%7d%7d%7d\n", k+1, thee->nx, thee->ny);
23 icol = 0;
24 for (j=0; j<ny; j++) {
25 for (i=0; i<nx; i++) {
26 u = k*(nx)*(ny)+j*(nx)+i;
27 icol++;
28 Vio_printf(sock, " %12.5e", thee->data[u]);
29 if (icol == 6) {
30 icol = 0;
31 Vio_printf(sock, "\n");
32 }
33 }
34 }
35 }