wiki:BovFiles

Version 1 (modified by Jonathan, 13 years ago) ( diff )

Back

BOV (Brick of Value) files

BOV files are the easiest way to get fixed grid data into visit. While the .bov files are what are opened in visit, the actual data itself is in an accompanying unformatted data file. Each BOV file contains meta data that describes the size, spatial extents, the time, the number of components for each cell, and the name of the actual data file. Those BOV files always come in pairs - one data file for each bov file. This is important to keep in mind when transferring files from one folder to another.

Writing to the bov file is fairly straightforward. See io/io_bov.f90 for an example. Writing to the data file is a little bit tricky because of the ordering of the fields.

First the data file has to be opened as unformatted.

OPEN(UNIT=UNIT_ID, FILE=FileName, status="replace", FORM="unformatted")

Then to output the data just execute

DO i=1,NrComps
  WRITE(UNIT_ID) q(:,:,:,i)
END DO

Note that this is different then

  WRITE(UNIT_ID) q(:,:,:,:)

because Fortran uses Column Major ordering

If we want to write a one-liner we have to swap the order by using a transpose

  WRITE(UNIT_ID) transpose(reshape(q(:,:,:,:), (/size(q)/NrComps,NrComps/)))

The .bov file contains information about the data as well as the location of the actual data file .dat which contains the raw unformatted binary data. Visit will only recognize the .bov files.

Note: See TracWiki for help on using the wiki.